Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 155
Default re-setting view of sheets so A1 is top left

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
--
Diddy
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default re-setting view of sheets so A1 is top left

Hi,

Try this

Sub Sonic()
Dim shts As Worksheet
Const TopLeft As String = "A1"
For Each Sheet In Worksheets
Application.Goto Sheet.Range(TopLeft), scroll:=True
Next
End Sub

Mike


"Diddy" wrote:

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
--
Diddy

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 155
Default re-setting view of sheets so A1 is top left

Thanks Mike,

Sorry for the delay I seem to be having problems accessing the website.

Thanks for your solution!!

Cheers
Diddy

"Mike H" wrote:

Hi,

Try this

Sub Sonic()
Dim shts As Worksheet
Const TopLeft As String = "A1"
For Each Sheet In Worksheets
Application.Goto Sheet.Range(TopLeft), scroll:=True
Next
End Sub

Mike


"Diddy" wrote:

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
--
Diddy

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
I need to change view in excel to left to right Tony Excel Discussion (Misc queries) 3 January 24th 09 05:23 PM
My Excel view is Right to Left instead of Left to Right !!! Akash Puri Excel Discussion (Misc queries) 2 May 5th 08 07:15 PM
Setting Top and Left of Modal UserForm Bart[_6_] Excel Programming 3 July 12th 07 04:17 PM
setting the Left or Right HeaderPicture mark_newbs Excel Programming 1 March 23rd 07 03:00 AM
View only items in the left column that have X's in right columns townieflo Excel Discussion (Misc queries) 2 November 23rd 05 04:12 PM


All times are GMT +1. The time now is 10:54 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"