D
Diddy
Hi everyone,
I'm using Excel 2003 and would like a macro that sets all sheets back to A1
so that when I save a wkbk I don't have to check each sheet to see that it is
displayed from the top.
I've tried this
Option Explicit
Dim Shts As Worksheet
Sub SettoA1()
'Resets all sheets to A1 (in my dreams!)
For Each Shts In ThisWorkbook.Worksheets
Shts.Activate
Application.Goto Reference:="R1C1"
Next
End Sub
I thought that this should work but does not seem to. What am I doing wrong?
I also thought that maybe it wasn't working because with some of my wkbks,
the data sheets are sent to me from another dept and they use Rows 1-5 for
info about where the data has come from and these rows are then hidden,
sheets are protected and also have data val on them so would be a hassle to
unhide each sheet.
So I took these sheets out to test macro and still did not seem to work.
If someone could tell me how to make it work, could they also consider a
workaround for my sheets with hidden rows please.
Many thanks
I'm using Excel 2003 and would like a macro that sets all sheets back to A1
so that when I save a wkbk I don't have to check each sheet to see that it is
displayed from the top.
I've tried this
Option Explicit
Dim Shts As Worksheet
Sub SettoA1()
'Resets all sheets to A1 (in my dreams!)
For Each Shts In ThisWorkbook.Worksheets
Shts.Activate
Application.Goto Reference:="R1C1"
Next
End Sub
I thought that this should work but does not seem to. What am I doing wrong?
I also thought that maybe it wasn't working because with some of my wkbks,
the data sheets are sent to me from another dept and they use Rows 1-5 for
info about where the data has come from and these rows are then hidden,
sheets are protected and also have data val on them so would be a hassle to
unhide each sheet.
So I took these sheets out to test macro and still did not seem to work.
If someone could tell me how to make it work, could they also consider a
workaround for my sheets with hidden rows please.
Many thanks