universaloneill
New Member
- Joined
- May 19, 2022
- Messages
- 3
- Office Version
- 365
- Platform
- Windows
So I'm new to doing this !!! I have used the record Macro function and then expanded when necessary. what I need help with is having my input box require a text entry. if its blank have and error message and for it to return to the message box, if cancelled the new sheet be removed and go back to the beginning. here's what I'm working with.
Thank you in advance
VBA Code:
Sub SAVE_TEMP_MAR()
'
' SAVE_TEMP_MAR Macro
'
'
Sheets("JP PRN.").Select
Sheets("JP PRN.").Copy Before:=Sheets(4)
Sheets("JP PRN. (2)").Select
Sheets("JP PRN. (2)").Name = ("TEMPORARY MAR")
ActiveWindow.SmallScroll Down:=-21
Range("A1:AF18").Select
Selection.ClearContents
Range("AG1").Select
Sheets("Blank MAR").Select
Range("A1:AF18").Select
Selection.Copy
Sheets("TEMPORARY MAR").Select
Range("A1").Select
ActiveSheet.Paste
Sheets("Blank MAR").Select
Range("AG1").Select
Sheets("TEMPORARY MAR").Select
Sheets("TEMPORARY MAR").Name = InputBox("Enter new name for the MAR." & vbNewLine & vbNewLine & "Please use Resident initials and name of Medication ")
Range("AG1").Select
Thank you in advance