question (vb/excel/cells/spacebar(char)
Author Message
 question (vb/excel/cells/spacebar(char))

How to remove "space" characters within an excel cell created by
pressing spacebar by mistake , using Visual Basic approach. This did not
make it!

StrInputString = strCell
Dim StrSearchPattern As String
StrSearchPattern = " "
Do While InStr(LCase(StrInputString),
StrSearchPattern)
Place = InStr(LCase(StrInputString),
StrSearchPattern)
StrInputString = Mid(StrInputString, 1, Place - 1)
& "" & Mid(StrInputString, Place +
Len(StrSearchPattern), Len(StrInputString))
Loop

TIM

--
Sent by 1 from  yahoo  part of com
This is a spam protected message. Please answer with reference header.
Posted via http://www.*-*-*.com/



Fri, 09 Sep 2005 01:52:23 GMT  
 question (vb/excel/cells/spacebar(char))
Are you trying to remove all spaces, or just extra spaces where there is
more than one together? In the first case you can use:

strinputstring = Replace(strinputstring, Space$(1), Space$(0))

. . . and in the second case you can use:

Do
strlen = Len(strinputstring)
strinputstring = Replace(strinputstring, Space$(2), Space$(1))
Loop While strlen = Len(strinputstring)

Mike



Quote:
> How to remove "space" characters within an excel cell created by
> pressing spacebar by mistake , using visual basic approach. This did not
> make it!

> StrInputString = strCell
> Dim StrSearchPattern As String
> StrSearchPattern = " "
> Do While InStr(LCase(StrInputString),
> StrSearchPattern)
> Place = InStr(LCase(StrInputString),
> StrSearchPattern)
> StrInputString = Mid(StrInputString, 1, Place - 1)
> & "" & Mid(StrInputString, Place +
> Len(StrSearchPattern), Len(StrInputString))
> Loop

> TIM

> --
> Sent by 1 from  yahoo  part of com
> This is a spam protected message. Please answer with reference header.
> Posted via http://www.usenet-replayer.com/cgi/content/new



Fri, 09 Sep 2005 03:10:15 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. DIRE NEED OF HELP!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

2. VB5 EXCEL 8.0 QUESTION ???????????????????????????????

3. Selected Excel Cell Address Determination Question

4. I need to get a cell or range of cell from Excel

5. I need to get a cell or range of cell from Excel

6. Question: Linking to merged Excel cells???

7. password char in System.Web.UI.WebControls.TextBox

8. VBA for Excel, nice homepage at http://www.100folhas.pt/software/excel.html

9. Grid cell 255 char max in 32-bit VB4.0

10. ? limit # of chars in DBGrid cell

11. Retrieving highlighted cells from Excel and return values to VB aplication

 

 
Powered by phpBB® Forum Software