View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default rename the new worksheet

Sub Create()
Dim ws As Worksheet
Dim wsName As String
If Not IsEmpty(ActiveCell) Then
newname = ActiveCell.Value
Set ws = Worksheets.Add
ws.Move After:=Sheets(Sheets.Count)
ws.Name = newname
End If
End Sub

you needed a little fix to the IsEmpty. You also need to capture the tab
name before the .Add

After the .Add the ActiveSheet becomes the new sheet!! Which is, of course,
totally empty.

--
Gary''s Student - gsnu200713