Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default Creating a new worksheet

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Creating a new worksheet

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   Report Post  
Posted to microsoft.public.excel.programming
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


.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default Creating a new worksheet

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default Creating a new worksheet

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




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Creating a new worksheet

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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a Worksheet zephyr Excel Discussion (Misc queries) 2 September 11th 06 07:25 AM
Creating or going to a worksheet sdg8481 Excel Programming 3 February 25th 06 01:42 PM
Creating a new worksheet? schoujar[_6_] Excel Programming 2 August 31st 05 07:43 AM
Creating a Worksheet in VBA Jako[_13_] Excel Programming 1 June 8th 04 11:09 PM
Creating a new worksheet from another Sheeny[_13_] Excel Programming 2 May 25th 04 06:14 PM


All times are GMT +1. The time now is 08:46 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"