macro to copy last sheet in workbook

B

Bill_S

I need a macro to copy the last sheet in my workbook and put the copy at the
very end of the workbook, in effect it becomes the new last sheet. Thanks
 
D

Dave Peterson

Option Explicit
Sub testem()
With Sheets
.Item(.Count).Copy _
after:=.Item(.Count)
End With
End Sub
 
B

Bill_S

Dave - excellent! I've got a follow-on question. When the new sheet is
created, two of the cells that are populated should be cleared out: the date
cell (E4) and the quote cell (G6.) What should I add to your macro to
accomplish that? thanks.
 
D

Dave Peterson

Option Explicit
Sub testme()
With Sheets
.Item(.Count).Copy _
after:=.Item(.Count)
End With
activesheet.range("e4,g6").clearcontents
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top