View Single Post
  #28   Report Post  
Posted to microsoft.public.excel.programming
Claus Busch Claus Busch is offline
external usenet poster
 
Posts: 3,872
Default Compare 2 Lists and Take an Action Q

Hi Sean,

Am Tue, 22 Nov 2016 05:14:09 -0800 (PST) schrieb :

I like your idea of code to delete, but I couldn't get it quite to work, some of the template formulas were not in the correct place. Ended up with a 'Template' sheet and copying that in


to delete all contents and insert the contents of "Template" try:
Sub RecNew()
Sheets("Report").UsedRange.ClearContents
Sheets("Template").UsedRange.Copy
Sheets("Report").Range("A1").PasteSpecial xlPasteAll
End Sub

Another way is to delete the sheet "Report" and create it new from
"Template":
Sub RecNew2()
Application.DisplayAlerts = False
Sheets("Report").Delete
Sheets("Template").Copy Befo=Sheets(1)
ActiveSheet.Name = "Report"
Application.DisplayAlerts = True
End Sub


Regards
Claus B.
--
Windows10
Office 2016