code on a template sheet

S

Saintsman

I have a template page in my workbook which users can copy & rename to record
cost estimates
Part of the sheet compares the previous estimate with the lastest
I want an update button which copies columns F-H & pastes the values in
columns C-E. This code needs to be in the 'template' sheet, but obviously
needs to work whenever the sheet is copied & renamed

I have a macro which works on a global scale, but how do I make it sheet
specific for sheets that haven't been created yet?

Sub copylast()
Sheets("Shell and Core").Select
Range("f6:h50").Select
Selection.Copy
Range("c6").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Range("f6").Select
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