+ Reply to Thread
Results 1 to 3 of 3

Moving sheets

  1. #1
    Greg
    Guest

    Moving sheets

    How do I write a macro to move the activesheet to the end of the active
    workbook.


    Thanks

    Greg



  2. #2
    Ardus Petus
    Guest

    Re: Moving sheets

    ActiveSheet.Move After:=Sheets(Sheets.Count)

    HTH
    --
    AP

    "Greg" <laptopgb@ihugnothere.com.au> a écrit dans le message de
    news:dvtilo$act$1@lust.ihug.co.nz...
    > How do I write a macro to move the activesheet to the end of the active
    > workbook.
    >
    >
    > Thanks
    >
    > Greg
    >
    >




  3. #3
    Registered User
    Join Date
    03-20-2006
    Posts
    23
    Sub macro1()

    Dim sheetnames() As String
    Dim sheetcount As Integer
    Dim i As Integer

    sheetcount = ActiveWorkbook.Sheets.Count
    ReDim sheetnames(1 To sheetcount)
    For i = 1 To sheetcount
    sheetnames(i) = ActiveWorkbook.Sheets(i).Name
    Next i

    ActiveWorkbook.ActiveSheet.Select
    ActiveWorkbook.ActiveSheet.Move After:=Sheets(sheetcount)
    End Sub

+ 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