How do I, in VBA, test to see if a cell has a specific word in it
I need to know what text is in an cell. The cell will be used to determine what sheet will be edited with the macro. |
How do I, in VBA, test to see if a cell has a specific word in it
A bit more info -- Don Guillett Microsoft MVP Excel SalesAid Software "The Inspector" <The wrote in message ... I need to know what text is in an cell. The cell will be used to determine what sheet will be edited with the macro. |
How do I, in VBA, test to see if a cell has a specific word in it
Sub SelectSheet() If ActiveCell.Value = MyValue Then Sheets("MyValue").Select Else Sheets("NotMyValue").Select End If End Sub Hope this helps. "The Inspector" wrote: I need to know what text is in an cell. The cell will be used to determine what sheet will be edited with the macro. |
How do I, in VBA, test to see if a cell has a specific word in it
do you mean If ActiveCell.Value = "MyValue" Then otherwise MyValue becomes a variable, defaulting to null and the IF condition will always be False "Brad" wrote in message ... Sub SelectSheet() If ActiveCell.Value = MyValue Then Sheets("MyValue").Select Else Sheets("NotMyValue").Select End If End Sub Hope this helps. "The Inspector" wrote: I need to know what text is in an cell. The cell will be used to determine what sheet will be edited with the macro. |
How do I, in VBA, test to see if a cell has a specific word in
Thanks guys "Patrick Molloy" wrote: do you mean If ActiveCell.Value = "MyValue" Then otherwise MyValue becomes a variable, defaulting to null and the IF condition will always be False "Brad" wrote in message ... Sub SelectSheet() If ActiveCell.Value = MyValue Then Sheets("MyValue").Select Else Sheets("NotMyValue").Select End If End Sub Hope this helps. "The Inspector" wrote: I need to know what text is in an cell. The cell will be used to determine what sheet will be edited with the macro. |
All times are GMT +1. The time now is 12:47 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com