View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] jennifer.trasatti@gmail.com is offline
external usenet poster
 
Posts: 1
Default Excel UserForm issues: Textboxes cannot be blank

I'm extremely new to this and I'm trying to use userforms for data
entry on a spreadsheet in excel. Im having issues with some of the data
entry. This is what I have so far:

Private Sub CommandButton1_Click()
ActiveWorkbook.Sheets("Sheet2").Activate
Range("J36").Select
Do
If IsEmpty(ActiveCell) = False Then
ActiveCell.Offset(1, 0).Select
End If
Loop Until IsEmpty(ActiveCell) = True
ActiveCell.Value = TextBox1
Range("K36").Select
Do
If IsEmpty(ActiveCell) = False Then
ActiveCell.Offset(1, 0).Select

End If
Loop Until IsEmpty(ActiveCell) = True
ActiveCell.Value = TextBox2
Range("L36").Select
Do
If IsEmpty(ActiveCell) = False Then
ActiveCell.Offset(1, 0).Select

End If
Loop Until IsEmpty(ActiveCell) = True
ActiveCell.Value = TextBox3
Unload Me
CJOForm.Show
End Sub

Private Sub CommandButton2_Click()
ActiveWorkbook.Sheets("Sheet2").Activate
Range("J36").Select
Do
If IsEmpty(ActiveCell) = False Then
ActiveCell.Offset(1, 0).Select
End If
Loop Until IsEmpty(ActiveCell) = True
ActiveCell.Value = TextBox1
Range("K36").Select
Do
If IsEmpty(ActiveCell) = False Then
ActiveCell.Offset(1, 0).Select

End If
Loop Until IsEmpty(ActiveCell) = True
ActiveCell.Value = TextBox2
Range("L36").Select
Do
If IsEmpty(ActiveCell) = False Then
ActiveCell.Offset(1, 0).Select

End If
Loop Until IsEmpty(ActiveCell) = True
ActiveCell.Value = TextBox3
Unload Me
End Sub
Private Sub UserForm_Click()
txtName.Value = ""
txtDate.Value = ""
txtName.SetFocus
End Sub

I want it to not let the person skip a textbox without entering some
information in. Right now, If i dont enter in an data, and click the
"done" command button it closes and enters no text but when I open the
form again it acts like there is text entered into the empty cells.
Does this even make sense? I'm not sure if I'm explaining myself well.
Please help! I've been working on this for hours and I just want to be
done!

Jennifer