Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hiya experts!! I have recorded!!!! ![]() macro that inserts new spreadsheets into the workbook and it just fail to deliver because of the set name e.g. "Sheet2". Could you please let me know how to make this new sheet a variable an then via a msgBox enable the user to rename it? I guess it would b something like that: Sheets("VARIABLE").Name = "msgBox INPUT" Many thanks! -- Petitboeu ----------------------------------------------------------------------- Petitboeuf's Profile: http://www.excelforum.com/member.php...fo&userid=1060 View this thread: http://www.excelforum.com/showthread.php?threadid=49517 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dim SheetName As String
SheetName = InputBox("Enter Sheet Name") If SheetName < "" Then CreateSheet SheetName .... Public Sub CreateSheet(SheetName As String) ' ' if the sheet already exists select it ' On Error GoTo CreateNewSheet Sheets(SheetName).Select Exit Sub ' ' if not create it ' CreateNewSheet: Sheets.Add After:=Sheets(Sheets.Count) Sheets(Sheets.Count).Name = SheetName ' End Sub "Petitboeuf" wrote: Hiya experts!! I have recorded!!!! ![]() macro that inserts new spreadsheets into the workbook and it just fails to deliver because of the set name e.g. "Sheet2". Could you please let me know how to make this new sheet a variable and then via a msgBox enable the user to rename it? I guess it would be something like that: Sheets("VARIABLE").Name = "msgBox INPUT" Many thanks!! -- Petitboeuf ------------------------------------------------------------------------ Petitboeuf's Profile: http://www.excelforum.com/member.php...o&userid=10602 View this thread: http://www.excelforum.com/showthread...hreadid=495170 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() thanks a lot! works a treat! :) I didn't think this would cause a problem but... I don't seem to b able to 'Select All' on my XL spreadsheet. It either does a Cells.Select for then Copy but fails when hittin it... Any ideas? :cool -- Petitboeu ----------------------------------------------------------------------- Petitboeuf's Profile: http://www.excelforum.com/member.php...fo&userid=1060 View this thread: http://www.excelforum.com/showthread.php?threadid=49517 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Add sheet name into a variable. | Excel Worksheet Functions | |||
variable sheet name | Excel Discussion (Misc queries) | |||
How To make a sheet reference Variable (eq: sum(sheet!D2:H2)) | Excel Discussion (Misc queries) | |||
Variable sheet and Formula Sheet | Excel Discussion (Misc queries) | |||
variable in a link where the variable is the name of the sheet | Excel Worksheet Functions |