andyreloaded
Board Regular
- Joined
- Aug 1, 2006
- Messages
- 80
I have a worksheet that gets copied frequently within the same workbook via the CTRL+CLICK and drag feature. In this worksheet I have the macro below to clear the contents of the range when the macro button is pressed. Is there any way to make this macro fire automatically only on the new sheet, and only when a new sheet is created?
Sub Clear_WSMESSAGEALL()
' Select named range WSMESSAGEALL and clear contents
Application.Goto Reference:="WSMESSAGEALL"
Selection.ClearContents
With Selection.Interior
.Pattern = xlNone
.TintAndShade = 0
.PatternTintAndShade = 0
End With
Application.Goto Reference:="HOME"
End Sub
Thanks,
Andy
Sub Clear_WSMESSAGEALL()
' Select named range WSMESSAGEALL and clear contents
Application.Goto Reference:="WSMESSAGEALL"
Selection.ClearContents
With Selection.Interior
.Pattern = xlNone
.TintAndShade = 0
.PatternTintAndShade = 0
End With
Application.Goto Reference:="HOME"
End Sub
Thanks,
Andy