Search : in
By :

Excel 2003 VB Macro for finding txt strings

Last answer on May 18, 2009 12:45:09 am BST swt, on May 6, 2009 4:32:54 pm BST 
 Report this message to moderators

Hello, I am trying to write an Excel 2003 Visual Basic Macro that searches a cell for a particular word. But the cell contains several words. So I can't just use a cell value match formula. Any suggestions would be greatly appreciated!

Configuration: Windows XP Internet Explorer 6.0

Best answers for « Excel 2003 VB Macro for finding txt strings » in :
VBA: Finding Hdc in an Excel worksheet or UserForm ShowVBA: Finding Hdc in an Excel worksheet or UserForm Here are two small examples on how to find Hdc in a worksheet: By clicking on Sheet1 the UserForm is displayed. Put the pointer on UF, hold the left mouse button down and drag the...
How to convert Excel into PDF? ShowHow to convert Excel into PDF? Here is a small tips about how to convert your excel files into PDF for your presentation. Step 1 PDF995 is software that gets installed on your computer which enables you to print any sources of document to...
Spreadsheets - The Excel Interface ShowExcel Introduction Microsoft Excel is the spreadsheet in the Microsoft Office office suite. To start it, simply click on the appropriate icon in the Start menu (in Windows) or click on an Excel file (that has an .xls file extension). A Excel...

1

psk, on May 18, 2009 12:38:02 am BST
  • +1

Hi,

Have you tried using the SEARCH function? This function returns the index of the first occurence of the word within a string. To get the logical value (True or False) instead of the index, you can compare the return value of SEARCH function to be greater than zero.

HTH

Happy coding!
psk

Reply to psk

2

 psk, on May 18, 2009 12:45:09 am BST
  • +1

Apologies, missed the fact that you need the *VBA* function for the macro and *not* the excel function for the formulas. You can use INSTR function in the VBA macro to achieve the same.

In addition, any Excel formula can be evaluated by passing the formula as string as a parameter to EVALUATE function in VBA. Hence, using EVALUATE, you can evaluate SEARCH function in the VBA macro too.

- psk

Reply to psk