Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro If statement to go to a specific cell in another worksheet
I have a worksheet that has a column for a Y or N answer. If the user
answers Y, I want a macro to run to jump to the other worksheet. I need the macro to run for each input of Y going down the worksheet. So, how do I link a macro to a Y or N answer in a cell, and how do I make the macro run relative to the cell with the Y answer? Any help on this is greatly appreciated. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro If statement to go to a specific cell in another worksheet
You could use a worksheet change event to do this. As an example:
Private Sub Worksheet_Change(ByVal Target As Range) If Target.Count = 1 And Target.Value = "Y" _ And Target.Column = 1 Then 'change column as required Sheets(2).Select End If End Sub would select the second sheet every time Y is entered into a cell in column A. This is worksheet event code. Right click the sheet tab, select view code and paste the event in there. For more on events see: http://www.cpearson.com/excel/events.htm Hope this helps Rowan wrote: I have a worksheet that has a column for a Y or N answer. If the user answers Y, I want a macro to run to jump to the other worksheet. I need the macro to run for each input of Y going down the worksheet. So, how do I link a macro to a Y or N answer in a cell, and how do I make the macro run relative to the cell with the Y answer? Any help on this is greatly appreciated. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Can I create an if statement that looks for a specific cell color? | Excel Worksheet Functions | |||
an if( statement looking for a specific phrase anywhere in a cell | Excel Worksheet Functions | |||
Macro/Loop If Statement Help -delete the row with the specific te | Excel Programming | |||
Macro to cut rows into another worksheet if a cell contains a specific word | Excel Programming | |||
Search for a specific character in a cell in an if statement | Excel Worksheet Functions |