Hello,
I found this VBA code and it works great but I would like to add 2 additional steps.
This code creates a new tab and names it based on what I have in cell M2. After this is done, I need this to clear the data from cells M2 thru M8 then go to the newly created sheet and land on A14. Can this be done?
Thanks for your help!
I found this VBA code and it works great but I would like to add 2 additional steps.
VBA Code:
Sub Copyrenameworksheet()
'Updateby Extendoffice
Dim ws As Worksheet
Set wh = Worksheets(ActiveSheet.Name)
ActiveSheet.Copy After:=Worksheets(Sheets.Count)
If wh.Range("M2").Value <> "" Then
ActiveSheet.Name = wh.Range("M2").Value
End If
wh.Activate
End Sub
This code creates a new tab and names it based on what I have in cell M2. After this is done, I need this to clear the data from cells M2 thru M8 then go to the newly created sheet and land on A14. Can this be done?
Thanks for your help!