Home |
Search |
Today's Posts |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If you still want the action on the click in column A and the sheet names
are in the adjacent cell in column B then you can do Private Sub Worksheet_SelectionChange(ByVal Target As Range) Dim sh as Worksheet if Target.count 1 then exit sub If Target.Column = 1 Then on Error Resume next set sh = Worksheets(Target.offset(0,1).Value) On error goto 0 if not sh is nothing then sh.Activate sh.Range("A1").Select End if End If End Sub -- Regards, Tom Ogilvy "Phil Hageman" wrote in message ... Tom, I'm running you around in circles, and I apolojize. What I need: User clicks Moves to worksheet B11 Letter B12 Consent B14 Statement etc. Cell addresses and worksheet names are all different. Sorry for the confusion - I thought this would be more straignt forward. Thanks, Phil "Tom Ogilvy" wrote: Private Sub Worksheet_SelectionChange(ByVal Target As Range) Dim lNum as long Dim sh as Worksheet if Target.count 1 then exit sub If Target.Column = 1 Then lNum = Target.Row + 1 on Error Resume next set sh = Worksheets("Sheet" & lNum) On error goto 0 if not sh is nothing then sh.Activate sh.Range("A1").Select End if End If End Sub -- Regards, Tom Ogilvy "Phil Hageman" wrote in message ... Tom, I stumbled on the "post" button before I was finished. My next step: User Click cell moved to worksheet A1 Sheet2 A2 Sheet3 A3 Sheet4 and so on.... Thanks, Phil "Tom Ogilvy" wrote: Assuming A1 is not already the activeCell on Sheet1 right click on the the tab for sheet1 and paste in the following code: Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Target.Address = "$A$1" Then Worksheets("Sheet2").Activate Worksheets("Sheet2").Range("A1").Select End If End Sub -- Tom Ogilvy "Phil Hageman" wrote in message ... When a user clicks on cell A1 in Sheet1, they are moved to Sheet2, cell A1. What would the code be? Thanks, Phil |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to increment a cell by 1 on mouse click or move to another cel | Excel Discussion (Misc queries) | |||
move to another cell on click | Excel Discussion (Misc queries) | |||
How can user move in locked worksheet but not copy cell contents? | Excel Worksheet Functions | |||
double click mouse, move to referenced wkbk/cell | Setting up and Configuration of Excel | |||
Finding cell that a user click? | Excel Programming |