Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 56
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,045
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 56
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,045
Default 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
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
Parse this string David Excel Discussion (Misc queries) 2 February 20th 07 04:57 AM
String Comparison Help needed (Simple I hope) Tim H[_2_] Excel Programming 3 January 26th 07 09:17 PM
Parse string loopoo[_29_] Excel Programming 2 April 3rd 06 10:14 AM
Parse String Geoff Murley Excel Programming 9 February 3rd 05 02:02 AM
String Parse J Excel Programming 3 August 10th 04 10:27 PM


All times are GMT +1. The time now is 02:10 AM.

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

About Us

"It's about Microsoft Excel"