Hi,
I am trying to save a new worksheet using a value in my sourcesheet and the tab name of the sourcesheet. My code works well if I just use the value, but as soon as I add the sourcesheet name code, I get an error. If I just do the A1 value it worksCan you help?
I am trying to save a new worksheet using a value in my sourcesheet and the tab name of the sourcesheet. My code works well if I just use the value, but as soon as I add the sourcesheet name code, I get an error. If I just do the A1 value it worksCan you help?
Code:
Sub NameNewWorksheet
Dim Name as String
Dim sourcesheet As Variant
activesheet.copy
Name = sourcesheet.range("A1").Value & " " & sourcesheet.Name
ActiveWorkbook.SaveAs Filename:=Name
End Sub
[\Code]