Macro to call worksheet when value entered

bluepenink

Well-known Member
Joined
Dec 21, 2010
Messages
585
Hello

I have a few worksheets in my workbook where i would like a macro in place, where, when i enter a value in cell X21, X31, X41, X51, X61...i want it to call sheet 55

sheet 55 = Contract sheet

so i would like sheet 2 to sheet 20 when cell X21, X31, X41, X51, X61 contain a number greater than 0 to simply go on the sheet 55

can someone pls help!

thx u
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
So, do you want sheet 55 to open (for the user to go to 55) or for the data to be passed there (data goes to 55)? I'm afraid for me it's not clear from your description.
 
Upvote 0
hello

sorry for the confusion.


basically, if a user from sheet 2 to sheet 22 enters a value greater than 0 in cells X21, X31, X41, X51, X61

i want when simply the macro to take the user to sheet 55 (contract sheet).

can u pls help?! let me know thx u
 
Upvote 0
Sheets 2 - 22, what are their names?

"sheet2", "sheet 2" or something else?
 
Upvote 0
Open up the vb editor, right click 'thisworkbook', choose 'view code' and paste in the following

Code:
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
    Dim r As Long, i As Long
    r = Val(Replace(Sh.Name, "Sheet", "", vbTextCompare))
    If r > 1 And r < 23 And Target.Column = 24 Then
        Select Case Target.Row
            Case 21, 31, 41, 51, 61
                Sheet55.Activate
        End Select
    End If
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,613
Messages
6,179,894
Members
452,948
Latest member
Dupuhini

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top