Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
parse a string and do a simple comparison
I am trying to parse a string and do a simple comparison, using VBA.
Here’s my VBA: (Trim(Mid(imgElement.Title, Search(":", imgElement.Title) + 2, 999))) < username Here is a sample of the imgElement.Title: EX-0010083GG05436.xls Checked Out To: Goldsmith, Teddy [HYH] Username comes from Windows_NT signon. I keep getting an error that reads ‘Sub or function not defined’ and Search (in my code above) is highlighted. What am I doing wrong? Thanks! Ryan-- |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
parse a string and do a simple comparison
On Mon, 26 Jul 2010 17:52:31 -0700 (PDT), ryguy7272
wrote: I am trying to parse a string and do a simple comparison, using VBA. Here’s my VBA: (Trim(Mid(imgElement.Title, Search(":", imgElement.Title) + 2, 999))) < username Here is a sample of the imgElement.Title: EX-0010083GG05436.xls Checked Out To: Goldsmith, Teddy [HYH] Username comes from Windows_NT signon. I keep getting an error that reads ‘Sub or function not defined’ and Search (in my code above) is highlighted. What am I doing wrong? Thanks! Ryan-- Search is not a VBA function; it is a worksheet function. Take a look at Instr for a similar VBA function (or use worksheetfunction.Search) |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
parse a string and do a simple comparison
On Jul 26, 8:00*pm, Ron Rosenfeld wrote:
On Mon, 26 Jul 2010 17:52:31 -0700 (PDT), ryguy7272 wrote: I am trying to parse a string and do a simple comparison, using VBA. Here’s my VBA: (Trim(Mid(imgElement.Title, Search(":", imgElement.Title) + 2, 999))) < username Here is a sample of the imgElement.Title: EX-0010083GG05436.xls Checked Out To: Goldsmith, Teddy [HYH] Username comes from Windows_NT signon. I keep getting an error that reads ‘Sub or function not defined’ and Search (in my code above) is highlighted. *What am I doing wrong? Thanks! Ryan-- Search is not a VBA function; it is a worksheet function. Take a look at Instr for a similar VBA function (or use worksheetfunction.Search) Thanks Ron!! |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
parse a string and do a simple comparison
On Thu, 29 Jul 2010 16:05:11 -0700 (PDT), ryguy7272
wrote: Thanks Ron!! You're welcome. Glad to help. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Parse this string | Excel Discussion (Misc queries) | |||
String Comparison Help needed (Simple I hope) | Excel Programming | |||
Parse string | Excel Programming | |||
Parse String | Excel Programming | |||
String Parse | Excel Programming |