Finding a particular character in a string using VBA

M

marston.gould

As it reads in the heading...

I tried to use Application.Find but that doesn't seem to be available.

I need to find the location of the first space in a character string.
Is there any easy way to do this?
 
N

Norman Jones

Hi Marston,

Sub Tester()
Dim sStr As String
Dim pos As Long
sStr = "ABC DEF"
pos = InStr(sStr, " ")
MsgBox pos
End Sub
 
M

Myrna Larson

Application.Find is the VBA equivalent of going to the Edit menu and selecting
Find. As Norman says, you use Instr for the equivalent of the worksheet
function FIND.
 
Top