943,929 Members | Top Members by Rank

Ad:
Oct 17th, 2008
0

VBA - Text search within cells

Expand Post »
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
Reputation Points: 10
Solved Threads: 1
Light Poster
jammiedude is offline Offline
32 posts
since Jun 2008
Oct 18th, 2008
0

Re: VBA - Text search within cells

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
Reputation Points: 10
Solved Threads: 4
Light Poster
K.Vanlalliana is offline Offline
44 posts
since Jul 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Problems With Do While... I think
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Need Help Calculating Days Active based on dates





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC