+ Reply to Thread
Results 1 to 3 of 3

Navigate Sheets - better way.

  1. #1
    Doug929
    Guest

    Navigate Sheets - better way.

    I want to navigate from one sheet to the other. Is there a better way then
    this....

    ' Go back and format previous sheet.
    Sheets(Worksheets.Count - 1).Select
    ' Format sheet.
    Call SB2_Format
    ' Come back and start again.
    Sheets(Worksheets.Count).Select



  2. #2
    Tom Ogilvy
    Guest

    Re: Navigate Sheets - better way.

    activesheet.previous.select
    SB2_Format
    ActiveSheet.Next.Select

    Not sure if it makes any difference.

    Another approach would be to modify SB2_format so you can pass a sheet
    reference to it and it can format that sheet without activating it.
    then the code could just be

    set sh = Activesheet.Prevous
    SB2_Format sh
    --
    Regards,
    Tom Ogilvy

    "Doug929" <[email protected]> wrote in message
    news:[email protected]...
    > I want to navigate from one sheet to the other. Is there a better way then
    > this....
    >
    > ' Go back and format previous sheet.
    > Sheets(Worksheets.Count - 1).Select
    > ' Format sheet.
    > Call SB2_Format
    > ' Come back and start again.
    > Sheets(Worksheets.Count).Select
    >
    >




  3. #3
    Doug929
    Guest

    Re: Navigate Sheets - better way.

    Thanks Tom, you have been helping for years! I appreciate it.

    "Tom Ogilvy" wrote:

    > activesheet.previous.select
    > SB2_Format
    > ActiveSheet.Next.Select
    >
    > Not sure if it makes any difference.
    >
    > Another approach would be to modify SB2_format so you can pass a sheet
    > reference to it and it can format that sheet without activating it.
    > then the code could just be
    >
    > set sh = Activesheet.Prevous
    > SB2_Format sh
    > --
    > Regards,
    > Tom Ogilvy
    >
    > "Doug929" <[email protected]> wrote in message
    > news:[email protected]...
    > > I want to navigate from one sheet to the other. Is there a better way then
    > > this....
    > >
    > > ' Go back and format previous sheet.
    > > Sheets(Worksheets.Count - 1).Select
    > > ' Format sheet.
    > > Call SB2_Format
    > > ' Come back and start again.
    > > Sheets(Worksheets.Count).Select
    > >
    > >

    >
    >
    >


+ 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