VBA - Text search within cells

Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Jun 2008
Posts: 17
Reputation: jammiedude is an unknown quantity at this point 
Solved Threads: 1
jammiedude's Avatar
jammiedude jammiedude is offline Offline
Newbie Poster

VBA - Text search within cells

 
0
  #1
Oct 17th, 2008
Could anybody help me with a problem i have?

I have a budget sheet and a list of incomes and expenses, and i need to be able to search a specific column and look for a certain text like general ( which may be displayed as "Commission - General") then copy the figure from column C. the trouble is that it needs to search the whole of column B looking for any cells that have the word "General" in.

Thanks
James
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 44
Reputation: K.Vanlalliana is an unknown quantity at this point 
Solved Threads: 3
K.Vanlalliana K.Vanlalliana is offline Offline
Light Poster

Re: VBA - Text search within cells

 
0
  #2
Oct 18th, 2008
You can Search particular word from any of the Column by using Searc string like this:

Sql="Select * FROM YourDatabaseName WHERE ColumntoSearch like '" & Trim(txtSearchTextBox.Text) & "%' ORDER BY toSearchColumnName"

So, the above code will Search whatever you write within the textbox 'txtSearchTextBox.Text'.


I hope this will give you an idea
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the Visual Basic 4 / 5 / 6 Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC