View Single Post
 
Old 11-25-2016, 05:50 AM
rod147 rod147 is offline Windows XP Office 2007
Novice
 
Join Date: Oct 2009
Posts: 3
rod147 is on a distinguished road
Default Setting a Worksheet Name as a Variable Help

I'm modifying some existing code to clear the contents of worksheet "RDBMerge" and then to set this worksheet as a variable called DestSh.Name
I've managed to clear the contents, but I need help with the second part to set it as a variable instead of creating a new RDBMerge worksheet.


' Clear the summary sheet.
Application.DisplayAlerts = False
On Error Resume Next
Sheets("RDBMergeSheet").UsedRange.ClearContents
On Error GoTo 0
Application.DisplayAlerts = True

' Add a new summary worksheet.
Set DestSh = ActiveWorkbook.Worksheets.Add
DestSh.Name = "RDBMergeSheet"
Reply With Quote