ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copy Active Worksheet (https://www.excelbanter.com/excel-programming/343406-copy-active-worksheet.html)

chris100[_35_]

Copy Active Worksheet
 

Hi all,

I just need to copy the active worksheet and paste in the same workbook
then activate that new sheet. I know how to do this manually but i need
the code to copy the sheet without referencing the actual name of the
sheet (because the name of the activesheet willl obviously depend on
which sheet i'm on).
I tried recording the macro but this obviously returns the sheet name
as part of the code - which is not quite what i want for subsequent
sheets.

Hope this is clear and if anyone wcould rustle up an answer before 3am
tomorrow morning (it's 10.30here) i would really appreciate it.

thanks a bundle,
Chris


--
chris100
------------------------------------------------------------------------
chris100's Profile: http://www.excelforum.com/member.php...o&userid=25166
View this thread: http://www.excelforum.com/showthread...hreadid=478055


chris100[_36_]

Copy Active Worksheet
 

Just figured out how to do this by piecing together a couple of other
lines from different places:

Sub Macro1()

ActiveSheet.Select
ActiveSheet.Copy befo=Sheets(1)
Application.Run "RefireBLP"

End Sub


--
chris100
------------------------------------------------------------------------
chris100's Profile: http://www.excelforum.com/member.php...o&userid=25166
View this thread: http://www.excelforum.com/showthread...hreadid=478055



All times are GMT +1. The time now is 04:45 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com