Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help Inputting a Name in a Macro
Hey,
Can someone provide me with the code to have a dialog box come up in the middle of my macro after creating a new sheet and have a dialog box come up that the user can type something into and that will be what the sheet's name is. Thanks Andrew |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help Inputting a Name in a Macro
Try something like:
Sub Test() Dim NewSh As Worksheet Dim sNewName As String Set NewSh = Sheets.Add NewName: On Error GoTo NotValidName sNewName = InputBox("Give the new sheet a name:", _ "New Name") NewSh.Name = sNewName Exit Sub NotValidName: MsgBox "Sorry, that is not a valid name." Resume NewName End Sub --- HTH Jason Atlanta, GA -----Original Message----- Hey, Can someone provide me with the code to have a dialog box come up in the middle of my macro after creating a new sheet and have a dialog box come up that the user can type something into and that will be what the sheet's name is. Thanks Andrew . |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help Inputting a Name in a Macro
thanks, works perfect
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
help with inputting code | New Users to Excel | |||
Inputting criteria into a macro/vb code | Excel Discussion (Misc queries) | |||
Inputting numbers using a macro. | Excel Discussion (Misc queries) | |||
Inputting date as dd/mm not mm/dd | Excel Discussion (Misc queries) | |||
inputting data | Excel Discussion (Misc queries) |