View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
OssieMac OssieMac is offline
external usenet poster
 
Posts: 2,510
Default Creating a new worksheet

Just for interest you can also add the sheet and name it in one line.

ActiveWorkbook.Worksheets.Add.Name = shtName

--
Regards,

OssieMac


"Gord Dibben" wrote:

Sub newsheet()
Dim shtname as String
shtname = InputBox("Type a name")
ActiveWorkbook.Worksheets.Add
ActiveSheet.Name = shtname
End Sub


Gord Dibben MS Excel MVP

On Sun, 03 Jan 2010 11:44:15 -0800, JasonK wrote:

TIA boys and girls.


I need a macro that will create a worksheet titled what ever the user
wants to name it.

I would guess that means it would open a dialog box and then name the
sheet what the user writes in the box. I just can't figure out how to
do it.

Thanks for all your help,

JasonK


.