I am stumped on how to create a header in A1, Sheet1 which combines the following text NLCAB BUDGET SUMMARY: followed by strProgramName - strProgramYear with strings derived from two input boxes coded in a standard module.
Public Sub btnEnterInfoIntoWorkbook()
Dim strProgramName As String
Dim strProgramYear As String
'Get the user's first and last name.
strProgramName = InputBox(Prompt:="Type the name of the program here. (Please use Title Case.)", Title:="ENTER NEW WORKBOOK INFORMATION")
strProgramYear = InputBox(Prompt:="Type the program's budget year here. (yyyy)", Title:="ENTER NEW WORKBOOK INFORMATION")
'Proceed only if both input boxes have text in them.
If strProgramName = "" Or strProgramYear = "" Then
MsgBox Prompt:="You did not enter all required information. You may edit as needed in the first row of the Budget Summary sheet."
Else
MsgBox Prompt:="You entered: " & strProgramName & " - " & strProgramYear & ". If this is not correct, you may edit in the first row of the Budget Summary sheet.", Title:="ENTER NEW WORKBOOK INFORMATION"
End If
End Sub
This code module does the following:[INDENT]1.) When file is opened, an input box asks for program name - (strProgramName),[INDENT]2.) Followed by a second input box asking for program year - (strProgramYear),[INDENT]3.) There is then a test to determine if both boxes return a value. If so, the sub ends,[INDENT]4.) If one or both input boxes have no information, there is another message and the sub ends.[INDENT]5.) In 3 and 4 above, the user is informed if there is incorrect or missing data and that data may be edited directly in cell A1, Sheet1.
The header should look like this:
NCCAB BUDGET SUMMARY: Program Name - Year
Formating as follows:
Ariel, 20pt, Bold; Caps as shown; Double spaces after colon, Name and hyphen; Program Name should be in case title format
Thank you very much for your assistance. :=)
Bookmarks