letawellman
New Member
- Joined
- Aug 12, 2011
- Messages
- 9
Hi all!!
I'm new to posting here, but I have been visiting and searching for awhile now. I have a small problem that is probably very easy to fix.
I have "inherited" an Excel app that lets the user open a copy of the template via a macro. That part works fine. I edited the macro to immediately pop up a message box for the user to fill in a particular field, called "Quote Number".
Now what I want to do is, AFTER the user has clicked OK on the message box (and then hopefully entered the requested data) I want it to run another macro renaming the worksheet to what the user JUST ENTERED in that field.
Here's my code to copy the template and generate the message box:
And I found this code to rename the worksheet here on MrExcel:
Now, how do I get the code to pause between the first macro long enough to allow the user to enter the data into the cell (in this case, "B7")?
Thanks!! I love this site and I love MrExcel's books!!
Leta
I'm new to posting here, but I have been visiting and searching for awhile now. I have a small problem that is probably very easy to fix.
I have "inherited" an Excel app that lets the user open a copy of the template via a macro. That part works fine. I edited the macro to immediately pop up a message box for the user to fill in a particular field, called "Quote Number".
Now what I want to do is, AFTER the user has clicked OK on the message box (and then hopefully entered the requested data) I want it to run another macro renaming the worksheet to what the user JUST ENTERED in that field.
Here's my code to copy the template and generate the message box:
Code:
Sub AddTemplate()
'
' Macro1 Macro
' Macro recorded 4/17/2006 by Dave Schroeder
'
' Keyboard Shortcut: Ctrl+q
'change tab name when updating price list
'
Sheets("Template 04042011").Select
Sheets("Template 04042011").Copy Before:=Sheets(1)
Select Case True
Case Range("B7") = ""
MsgBox "Please enter the new Quote Number"
End Select
'RenameSheet
End Sub
And I found this code to rename the worksheet here on MrExcel:
Code:
Public Sub RenameSheet()
NewName = Range("B7").Value
ActiveSheet.Name = NewName
End Sub
Now, how do I get the code to pause between the first macro long enough to allow the user to enter the data into the cell (in this case, "B7")?
Thanks!! I love this site and I love MrExcel's books!!
Leta