Hello aboveliquidice,
The attached workbook is far from being comprehensive for your needs, but it does demonstrate the basic approach to your problem. VBA UserForms are by far the best way to manipulate data in database.
After you open the workbook, click the button on "Sheet 3" to activate the form. You can then add a new patient worksheet using the names you have entered. When the sheet prints, the patient's name is in Arial 24 Point bold type and centered on the page. You change the font and size to what you want to use. They are highlighted in red in code below.
Here is the code behind the UserForm...
Private Sub CommandButton1_Click()
'CLOSE USERFORM
Me.Hide
Unload Me
End Sub
Private Sub CommandButton2_Click()
'ADD NEW PATIENT WORKSHEET
Dim PatientName As String
Dim Wks As Worksheet
'Patient's name is last name first
PatientName = TextBox2 & ", " & TextBox1
'Check If Patient Sheet exists
For Each Wks In Worksheets
If Wks.Name = PatientName Then
MsgBox "A sheet already exists for " & PatientName
Exit Sub
End If
Next Wks
With Worksheets
'Add the new worksheet
Set Wks = .Add(After:=Worksheets(.Count))
'Name it for the patient
Wks.Name = PatientName
'Set the Center Header to Arial 24 point, centered, bold
Wks.PageSetup.CenterHeader = "&""Arial"" &C &B &24" & PatientName
End With
End Sub
Private Sub UserForm_Activate()
TextBox1.SetFocus
End Sub
Bookmarks