Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Macro to loop thru sheets & return to a1 cell

I am a newbie. I'm trying to write a macro to loop through all of the sheets
in a workbook and return the cursor to the home (A1) position. Seems like it
should be fairly simple to me, but I just can't get it to work. Thanks for
your help.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 114
Default Macro to loop thru sheets & return to a1 cell

Try this,

Sheets.Select
Range("a1").Select
sheets(1).select


Regards,
Shah Shailesh
http://members.lycos.co.uk/shahweb/
(Excel Add-ins)

*** Sent via Developersdex http://www.developersdex.com ***
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Macro to loop thru sheets & return to a1 cell


Set sh = activesheet
For Each sh1 In Worksheets.Count
sh1.ACtivate
Range("A1").Select
Next sh1
sh.Activate

--

HTH

RP
(remove nothere from the email address if mailing direct)


"CassieM" wrote in message
...
I am a newbie. I'm trying to write a macro to loop through all of the

sheets
in a workbook and return the cursor to the home (A1) position. Seems like

it
should be fairly simple to me, but I just can't get it to work. Thanks

for
your help.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default Macro to loop thru sheets & return to a1 cell

try this. No loop

Sub fixsheets()
Sheets.Select
Range("a1").Select
Sheet1.Select
End Sub
--
Don Guillett
SalesAid Software

"CassieM" wrote in message
...
I am a newbie. I'm trying to write a macro to loop through all of the

sheets
in a workbook and return the cursor to the home (A1) position. Seems like

it
should be fairly simple to me, but I just can't get it to work. Thanks

for
your help.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Macro to loop thru sheets & return to a1 cell

Thank you all so much. I can see my beginner's error now!

"Don Guillett" wrote:

try this. No loop

Sub fixsheets()
Sheets.Select
Range("a1").Select
Sheet1.Select
End Sub
--
Don Guillett
SalesAid Software

"CassieM" wrote in message
...
I am a newbie. I'm trying to write a macro to loop through all of the

sheets
in a workbook and return the cursor to the home (A1) position. Seems like

it
should be fairly simple to me, but I just can't get it to work. Thanks

for
your help.






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
Return information in one cell based on search in other sheets Mike[_2_] Excel Discussion (Misc queries) 1 April 10th 10 03:41 AM
return same cell value from numerous sheets Laurie Excel Worksheet Functions 5 April 11th 08 02:19 PM
Return a blank cell instead of a zero value for two linked sheets. Matt Excel Discussion (Misc queries) 1 February 4th 07 02:37 AM
Return all sheets to cell A1 glenlee Excel Discussion (Misc queries) 4 September 25th 05 01:03 PM
Loop through workbooks in a folder and return the value of cell M43 RockNRoll[_2_] Excel Programming 1 January 21st 04 07:46 PM


All times are GMT +1. The time now is 06:01 PM.

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"