Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 . |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks OssieMac --
On Sun, 3 Jan 2010 13:29:01 -0800, OssieMac wrote: Just for interest you can also add the sheet and name it in one line. ActiveWorkbook.Worksheets.Add.Name = shtName |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Good point.
Thanks, Gord On Sun, 3 Jan 2010 13:29:01 -0800, OssieMac wrote: Just for interest you can also add the sheet and name it in one line. ActiveWorkbook.Worksheets.Add.Name = shtName |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Gord -- worked perfectly
On Sun, 03 Jan 2010 12:27:27 -0800, Gord Dibben <gorddibbATshawDOTca 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Creating a Worksheet | Excel Discussion (Misc queries) | |||
Creating or going to a worksheet | Excel Programming | |||
Creating a new worksheet? | Excel Programming | |||
Creating a Worksheet in VBA | Excel Programming | |||
Creating a new worksheet from another | Excel Programming |