Copyingworksheets

  • Thread starter Thread starter Andyg
  • Start date Start date
A

Andyg

I create daily reports with data linked from day to day. Many cells are
protectyed formulas.

I'd like to create a macro to copy the current report, creating the next
day's base report.
 
Simply record a macro while you copy the sheet. Or use code similar to
below. This will copy the sheet, i haven't checked about linked data/
formulas but presume your new sheet would be linked to the sheet 2
days ago.

Sub copysheet()
Dim thissht
Dim newshtname
thissht = InputBox("What is the name of the existing sheet you wish to
copy?")
ActiveWorkbook.Sheets(thissht).Copy Before:=Sheets(1)
newshtname = InputBox("What would you like to call the new
sheet?")
ActiveWorkbook.ActiveSheet.Name = newshtname
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

Back
Top