Hi,
I'm trying to repeat the code below for
several different cells. Everything stays the same but
the cell (range) changes and msg - there are about 20
different ones. I could just keep writing the if
statement over and over but I know there is a better way.
I was thinking case select but I can't make it work.
Please help!
Amy
Private Sub CommandButton1_Click()
Dim Title As String
Dim result As Variant
Dim cell As Range
Dim msg As String
Title = "Incomplete information"
Set cell = Application.Worksheets("Facility Request".Range
("d25"
msg = "Please enter the Date the Facilities are Required."
If IsEmpty(cell) = True Then
result = InputBox(msg, Title)
cell.Value = result
End If
End Sub
I'm trying to repeat the code below for
several different cells. Everything stays the same but
the cell (range) changes and msg - there are about 20
different ones. I could just keep writing the if
statement over and over but I know there is a better way.
I was thinking case select but I can't make it work.
Please help!
Amy
Private Sub CommandButton1_Click()
Dim Title As String
Dim result As Variant
Dim cell As Range
Dim msg As String
Title = "Incomplete information"
Set cell = Application.Worksheets("Facility Request".Range
("d25"
msg = "Please enter the Date the Facilities are Required."
If IsEmpty(cell) = True Then
result = InputBox(msg, Title)
cell.Value = result
End If
End Sub