+ Reply to Thread
Results 1 to 7 of 7

Macro to loop thru sheets & return to a1 cell

  1. #1
    CassieM
    Guest

    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. #2
    Forum Contributor funkymonkUK's Avatar
    Join Date
    01-07-2005
    Location
    London, England
    Posts
    500

    Talking

    ummm why do you want to loop through the sheets just to end at the begin? I have some code that might work. what it does is loop through all the sheets and tries to find and item and then returns back to the home sheet. let me know.

  3. #3
    Shailesh Shah
    Guest

    Re: 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 ***

  4. #4
    Bob Phillips
    Guest

    Re: 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" <CassieM@discussions.microsoft.com> wrote in message
    news:0B507E93-D065-4E6E-83C6-DD7EE270B305@microsoft.com...
    > 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. #5
    Don Guillett
    Guest

    Re: 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
    donaldb@281.com
    "CassieM" <CassieM@discussions.microsoft.com> wrote in message
    news:0B507E93-D065-4E6E-83C6-DD7EE270B305@microsoft.com...
    > 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.




  6. #6
    CassieM
    Guest

    Re: 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
    > donaldb@281.com
    > "CassieM" <CassieM@discussions.microsoft.com> wrote in message
    > news:0B507E93-D065-4E6E-83C6-DD7EE270B305@microsoft.com...
    > > 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.

    >
    >
    >


  7. #7
    Don Guillett
    Guest

    Re: Macro to loop thru sheets & return to a1 cell

    glad to help

    --
    Don Guillett
    SalesAid Software
    donaldb@281.com
    "CassieM" <CassieM@discussions.microsoft.com> wrote in message
    news:1413EAE9-040C-4037-B1B5-1161FE43AA60@microsoft.com...
    > 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
    > > donaldb@281.com
    > > "CassieM" <CassieM@discussions.microsoft.com> wrote in message
    > > news:0B507E93-D065-4E6E-83C6-DD7EE270B305@microsoft.com...
    > > > 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1