Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
What code is required in a macro to set the cursor to the
top left or the bottom right in multiple worksheets? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dim sh as Object
Dim Sh1 as Object set sh1 = Activesheet for each sh in ActiveWindow.Selectedsheets sh.Activate Range("A1").Select Next Sh1.Activate change Range("A1").Select to cells.SpecialCells(xlCellTypeLastCell).Select for the bottom right. -- Regards, Tom Ogilvy "Rick" wrote in message ... What code is required in a macro to set the cursor to the top left or the bottom right in multiple worksheets? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Tom:
Thanks for your response. I pasted the code into a macro, but when it is run it positions the cursor in A1 on the first worksheet only. I have over 35 sheets in the workboook which I have to do this with. Rick -----Original Message----- Dim sh as Object Dim Sh1 as Object set sh1 = Activesheet for each sh in ActiveWindow.Selectedsheets sh.Activate Range("A1").Select Next Sh1.Activate change Range("A1").Select to cells.SpecialCells(xlCellTypeLastCell).Select for the bottom right. -- Regards, Tom Ogilvy "Rick" wrote in message ... What code is required in a macro to set the cursor to the top left or the bottom right in multiple worksheets? . |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You said multiple sheets - not all sheets - so I assumed you grouped the
sheets to indicate which ones to do. . Dim sh as Object Dim Sh1 as Object set sh1 = Activesheet for each sh in ActiveWorkbooks.Worksheets sh.Activate Range("A1").Select Next Sh1.Activate Does all sheets. -- Regards, Tom Ogilvy "Rick" wrote in message ... Hi Tom: Thanks for your response. I pasted the code into a macro, but when it is run it positions the cursor in A1 on the first worksheet only. I have over 35 sheets in the workboook which I have to do this with. Rick -----Original Message----- Dim sh as Object Dim Sh1 as Object set sh1 = Activesheet for each sh in ActiveWindow.Selectedsheets sh.Activate Range("A1").Select Next Sh1.Activate change Range("A1").Select to cells.SpecialCells(xlCellTypeLastCell).Select for the bottom right. -- Regards, Tom Ogilvy "Rick" wrote in message ... What code is required in a macro to set the cursor to the top left or the bottom right in multiple worksheets? . |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Tom:
I received a "required object" error when running this code. However; I looked at the "ActiveWorkbooks.Worksheets" reference and changed it to "ActiveWorkbook.Worksheets" which seems to work. No need to respond to this unless the change is incorrect. Thanks for your help. Rick -----Original Message----- You said multiple sheets - not all sheets - so I assumed you grouped the sheets to indicate which ones to do. . Dim sh as Object Dim Sh1 as Object set sh1 = Activesheet for each sh in ActiveWorkbooks.Worksheets sh.Activate Range("A1").Select Next Sh1.Activate Does all sheets. -- Regards, Tom Ogilvy "Rick" wrote in message ... Hi Tom: Thanks for your response. I pasted the code into a macro, but when it is run it positions the cursor in A1 on the first worksheet only. I have over 35 sheets in the workboook which I have to do this with. Rick -----Original Message----- Dim sh as Object Dim Sh1 as Object set sh1 = Activesheet for each sh in ActiveWindow.Selectedsheets sh.Activate Range("A1").Select Next Sh1.Activate change Range("A1").Select to cells.SpecialCells(xlCellTypeLastCell).Select for the bottom right. -- Regards, Tom Ogilvy "Rick" wrote in message ... What code is required in a macro to set the cursor to the top left or the bottom right in multiple worksheets? . . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Cursor position after saving | Excel Discussion (Misc queries) | |||
cursor position | Excel Discussion (Misc queries) | |||
Cursor position | Excel Discussion (Misc queries) | |||
Cursor position? | Excel Discussion (Misc queries) | |||
cursor position | Excel Programming |