Finding a particular character in a string using VBA
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? |
Finding a particular character in a string using VBA
Hi Marston,
Sub Tester() Dim sStr As String Dim pos As Long sStr = "ABC DEF" pos = InStr(sStr, " ") MsgBox pos End Sub -- --- Regards, Norman " wrote in message ... 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? |
Finding a particular character in a string using VBA
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. On 13 Sep 2004 17:41:33 -0700, " wrote: 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? |
All times are GMT +1. The time now is 05:12 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com