LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Detecting the space character

Hi All,

I am trying to detect the space character in a string but my code is not
working.

Thanks for your help.
JN

sub demo()

Dim strlength As Integer
Dim str As String

str = "good morning"

strlength = Len(Trim(str))

For i = 1 To strlength
If Mid(str, i, strlength) = Chr(32) Then
MsgBox "space"
End If
Next i

End Sub


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
is 3rd character in a cell a space? Rick[_10_] Excel Worksheet Functions 5 December 21st 09 07:22 PM
Can i give Space/some other character in between the cell? sumit Excel Worksheet Functions 5 December 9th 08 07:34 AM
How do I replace a BEL Character of 7 with a space KBear Excel Discussion (Misc queries) 1 June 6th 06 03:56 PM
NEED HELP-----Removing a space at the end of a string of character FRS Excel Discussion (Misc queries) 7 April 13th 06 03:57 AM
How can I insert a space before the last character in a range of cells Jeff[_25_] Excel Programming 8 November 13th 03 07:45 PM


All times are GMT +1. The time now is 05:21 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"