+ Reply to Thread
Results 1 to 2 of 2

How can I move a sheet to the end of the workbook in VB?

  1. #1
    Jon Davie
    Guest

    How can I move a sheet to the end of the workbook in VB?

    I know how to move the sheets around:

    Sheets("1996").Select
    Sheets("1996").Move After:=Sheets(2)

    But how can I move the sheet to the end of the book if the number of sheets
    in the book changes often?

  2. #2
    Chip Pearson
    Guest

    Re: How can I move a sheet to the end of the workbook in VB?

    Jon,

    Try the following:

    With ThisWorkbook.Worksheets
    .Item("1996").Move after:=.Item(.Count)
    End With


    --
    Cordially,
    Chip Pearson
    Microsoft MVP - Excel
    Pearson Software Consulting, LLC
    www.cpearson.com



    "Jon Davie" <Jon [email protected]> wrote in
    message
    news:[email protected]...
    >I know how to move the sheets around:
    >
    > Sheets("1996").Select
    > Sheets("1996").Move After:=Sheets(2)
    >
    > But how can I move the sheet to the end of the book if the
    > number of sheets
    > in the book changes often?




+ 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