View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
oercim oercim is offline
external usenet poster
 
Posts: 51
Default adding a sheet and renaming

Hello. With excel macro, I want to add a sheet and rename the
sheet but the name is not specific, it is a variable. For example,

Sub b()
Sheets.Add.Name = "aaaa"
End Sub

works fine but here , the sheet name is not variable, it is
specific named "aaaa",
However, the below gives error

Sub b()
Dim a As String
a = "aaaa"
Sheets.Add.Name = a
End Sub

What can I do? Thanks alot.