Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 52
Default Position cursor in multiple worksheets

What code is required in a macro to set the cursor to the
top left or the bottom right in multiple worksheets?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Position cursor in multiple worksheets

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 52
Default Position cursor in multiple worksheets

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Position cursor in multiple worksheets

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 52
Default Position cursor in multiple worksheets

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
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
Cursor position after saving JimK Excel Discussion (Misc queries) 2 December 8th 09 08:45 PM
cursor position MarkT Excel Discussion (Misc queries) 5 February 7th 07 01:25 PM
Cursor position saziz Excel Discussion (Misc queries) 2 August 9th 05 08:19 PM
Cursor position? Marc Excel Discussion (Misc queries) 1 March 27th 05 07:09 PM
cursor position NTL Excel Programming 1 January 18th 04 08:23 PM


All times are GMT +1. The time now is 04:23 AM.

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

About Us

"It's about Microsoft Excel"