How do I write a macro to move the activesheet to the end of the active
workbook.
Thanks
Greg
How do I write a macro to move the activesheet to the end of the active
workbook.
Thanks
Greg
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
>
>
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
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks