Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default 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.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 846
Default 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.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default 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.


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default 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.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calcuting sum of specific word "P" within specific cell range (A5: billy liddel Excel Worksheet Functions 3 September 26th 09 12:17 PM
Highlight a cell with a specific word in it Soulscream Excel Worksheet Functions 5 January 10th 08 09:20 PM
Link from a specific Cell in Excel to a specific para. in Word CathyK Excel Worksheet Functions 0 August 10th 06 04:40 PM
Extracting specific word in a cell Conditional Formatting Excel Worksheet Functions 2 February 14th 06 09:57 PM
how do I make a word typed in a cell go to a specific cell in anot Lmatarazzo Excel Discussion (Misc queries) 3 April 21st 05 04:29 AM


All times are GMT +1. The time now is 08:46 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"