It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming Visual Basic Forum

string search

Moderator: dafunkymunky

string search

Postby anthonycrimin on Fri Aug 12, 2011 1:52 pm

I know how to search for a string then select the data below the string header. However if the string does not exist how to a simply jump to the next string search with VBA showing an error because it cannot find the previous string.

many thanks

Anthony
anthonycrimin
 
Posts: 1
Joined: Fri Aug 12, 2011 1:49 pm

Re: string search

Postby mangaluli on Fri Sep 16, 2011 11:45 am

I did not understand but maybe you mean this:

if string = "123" then
code code code
end if

if string = "456" then
code code code
end if

Or you can use "Case" (Faster and cleaner)

Select Case string
Case "123"
CODE! HERE!
Case "456"
CODE! HERE!
Case "789"
CODE! HERE!
Case Else
CODE! HERE! ELSE!
End Select
mangaluli
 
Posts: 3
Joined: Fri Sep 16, 2011 11:25 am


Who is online

Users browsing this forum: No registered users and 5 guests