vba Range().Select

Pinaceous

Well-known Member
Joined
Jun 11, 2014
Messages
1,124
Office Version
  1. 365
Platform
  1. Windows
Hello Everyone,

How would you create a macro for the curser to go to
Code:
 Range(A1).Select
for every ODD sheet?

Likewise, how would you create a macro for the curser to go to
Code:
 Range(B1).Select
for every EVEN sheet?

Many thanks in advance!
Pinaceous
 
IF you are going with sheetnames, change .CodeName to .Name in post #9 . Change Ken to FORMAT. Change K1 to B11. Change Sheet3 to TOTALS.
 
Last edited:
Upvote 0

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Code:
Private Sub Workbook_SheetActivate(ByVal Sh As Object)
    If Sh.Name = "TOTALS" Then
        Sh.[C1].Activate
    ElseIf Sh.Name = "FORMAT" Then
        Sh.[B11].Activate
    ElseIf Sh.Index Mod 2 = 0 Then
        Sh.[B1].Activate
    Else
        Sh.[A1].Activate
    End If
End Sub
 
Upvote 0
Thank you Kenneth & Dim Me xlNoob !! I'm going to go with post #12 for my application.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,830
Messages
6,181,229
Members
453,026
Latest member
cknader

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