954,153 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

VBA - Text search within cells

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

jammiedude
Light Poster
32 posts since Jun 2008
Reputation Points: 10
Solved Threads: 1
 

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

K.Vanlalliana
Light Poster
44 posts since Jul 2008
Reputation Points: 10
Solved Threads: 4
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You