View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default Putting woirksheet name into a variable

try this:-

Sub filefile()
With ThisWorkbook
.Sheets.Add After:=.Sheets(.Sheets.Count)
End With
myName = ActiveSheet.Name
msgbox myName
End Sub

"BZeyger" wrote:

I have a form where a new sheet is created in a workbook. Everytime a sheet
is created it incraments up (sheet1, sheet2, sheet3, sheet4). I was tring to
put the active sheet name into a varable but I do not know the syntax.