Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / March 2006

Tip: Looking for answers? Try searching our database.

Moving sheets

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Greg - 23 Mar 2006 08:28 GMT
How do I write a macro to move the activesheet to the end of the active
workbook.

Thanks

Greg
Ardus Petus - 23 Mar 2006 09:08 GMT
   ActiveSheet.Move After:=Sheets(Sheets.Count)

HTH
--
AP

> How do I write a macro to move the activesheet to the end of the active
> workbook.
>
> Thanks
>
> Greg
ReD-DevIL - 23 Mar 2006 09:28 GMT
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

Signature

ReD-DevIL

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.