View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Qaspec Qaspec is offline
external usenet poster
 
Posts: 96
Default Stipulation in command

I would like to add a stipulation to my sub that will check each text box for
a value. If a box is empty I would like the user to be directed to fill out
all information before they could continue.

Here is the sub:

Private Sub SaveCase_Click()

If Worksheets("Data").Range("A1") = "" Then

Worksheets("Data").Range("A1") = TBfud.Value
Worksheets("Data").Range("B1") = TBicd.Value
Worksheets("Data").Range("A1") = TBcn.Value

Else

Worksheets("Data").Range("A" & Rows.Count).End(xlUp).Offset(1, 0) =
TBfud.Value
Worksheets("Data").Range("B" & Rows.Count).End(xlUp).Offset(1, 0) =
TBicd.Value
Worksheets("Data").Range("C" & Rows.Count).End(xlUp).Offset(1, 0) = TBcn.Value


End If

MsgBox "Case Added" & vbCrLf & "Remember to save the file before you
close.", vbOKOnly, "Case Tracking File"

Sheets("Cases").TBfud.Value = ""
Sheets("Cases").TBicd.Value = ""
Sheets("Cases").TBcn.Value = ""

End Sub