Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
WBTKbeezy
 
Posts: n/a
Default change sheet name macro

I have a large spreadsheet and I am trying to add a macro that allows me to
add a worksheet AND have an input box pop up so I can name the worksheet
whatever name I need it to be. Is this possible?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Duke Carey
 
Posts: n/a
Default change sheet name macro

VERY QUICK & VERY DIRTY

Sub newsheet()
Dim ws As Worksheet
Dim nm As String

Set ws = Worksheets.Add
ws.Name = InputBox("sheet name")
End Sub



"WBTKbeezy" wrote:

I have a large spreadsheet and I am trying to add a macro that allows me to
add a worksheet AND have an input box pop up so I can name the worksheet
whatever name I need it to be. Is this possible?

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
WBTKbeezy
 
Posts: n/a
Default change sheet name macro

That is perfect, quick and dirty can work sometimes...

Now is there a way to put it in a sepecific place in the workbook?

"Duke Carey" wrote:

VERY QUICK & VERY DIRTY

Sub newsheet()
Dim ws As Worksheet
Dim nm As String

Set ws = Worksheets.Add
ws.Name = InputBox("sheet name")
End Sub



"WBTKbeezy" wrote:

I have a large spreadsheet and I am trying to add a macro that allows me to
add a worksheet AND have an input box pop up so I can name the worksheet
whatever name I need it to be. Is this possible?

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Duke Carey
 
Posts: n/a
Default change sheet name macro

Yup. The .Add method takes optional parameters of Before and/or After, so
you can specify where. In this case it is BEFORE sheet1

Sub newsheet()
Dim ws As Worksheet
Dim nm As String

Set ws = Worksheets.Add(befo=Worksheets("Sheet1"))
ws.Name = InputBox("sheet name")
End Sub


"WBTKbeezy" wrote:

That is perfect, quick and dirty can work sometimes...

Now is there a way to put it in a sepecific place in the workbook?

"Duke Carey" wrote:

VERY QUICK & VERY DIRTY

Sub newsheet()
Dim ws As Worksheet
Dim nm As String

Set ws = Worksheets.Add
ws.Name = InputBox("sheet name")
End Sub



"WBTKbeezy" wrote:

I have a large spreadsheet and I am trying to add a macro that allows me to
add a worksheet AND have an input box pop up so I can name the worksheet
whatever name I need it to be. Is this possible?

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
WBTKbeezy
 
Posts: n/a
Default change sheet name macro

Okay getting there... but now is there a way to have an input box for what
sheet you would like it before?

"Duke Carey" wrote:

Yup. The .Add method takes optional parameters of Before and/or After, so
you can specify where. In this case it is BEFORE sheet1

Sub newsheet()
Dim ws As Worksheet
Dim nm As String

Set ws = Worksheets.Add(befo=Worksheets("Sheet1"))
ws.Name = InputBox("sheet name")
End Sub


"WBTKbeezy" wrote:

That is perfect, quick and dirty can work sometimes...

Now is there a way to put it in a sepecific place in the workbook?

"Duke Carey" wrote:

VERY QUICK & VERY DIRTY

Sub newsheet()
Dim ws As Worksheet
Dim nm As String

Set ws = Worksheets.Add
ws.Name = InputBox("sheet name")
End Sub



"WBTKbeezy" wrote:

I have a large spreadsheet and I am trying to add a macro that allows me to
add a worksheet AND have an input box pop up so I can name the worksheet
whatever name I need it to be. Is this possible?

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
Using this Automatic Resizing Macro with Worksheet Change [email protected] Excel Discussion (Misc queries) 0 December 19th 05 03:57 PM
Formulas not recalculating when values change on another sheet Bill Excel Worksheet Functions 0 September 15th 05 10:29 PM
change sheet tab color? mark Excel Discussion (Misc queries) 2 May 26th 05 11:18 PM
Copy cell format to cell on another worksht and update automatical kevinm Excel Worksheet Functions 21 May 19th 05 11:07 AM
How do I change macro text with another macro? Eric Excel Discussion (Misc queries) 4 April 27th 05 11:20 PM


All times are GMT +1. The time now is 05:56 AM.

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

About Us

"It's about Microsoft Excel"