DutchKevin
Board Regular
- Joined
- Apr 13, 2011
- Messages
- 133
- Office Version
- 365
- Platform
- Windows
Hi Guys,
I'm trying to get my new worksheet to be renamed to a value from a list of names.
It works if I put a hardcell reference there like "E7", but i'd like it to be incremented every time the macro runs. (Column E holds the names, on sheet "Total")
Thanks for helping
Kevin
I'm trying to get my new worksheet to be renamed to a value from a list of names.
It works if I put a hardcell reference there like "E7", but i'd like it to be incremented every time the macro runs. (Column E holds the names, on sheet "Total")
Code:
Sub Newsheet()
Dim j As Long
j = (Sheets.Count)
Sheets.Add after:=Sheets(Sheets.Count)
' ActiveSheet.Name = (Sheets.Count) gives a simple seq number to sheet
' ActiveSheet.Name = Worksheets("total").Range("c1").Value gives a defined name to sheet
ActiveSheet.Name = Sheets("total").Range(5, j).Value
End Sub
Kevin