underpressure
Board Regular
- Joined
- Nov 24, 2012
- Messages
- 141
This UserFormAddMembers code is used to add new members to Sheets(“Members”)
I wish to use the same UserForm to update Member Data when cells are empty.
So, I’m struggling with how to best integrate these ideas into the procedure:
If
.Cells(i, "D") is empty
.Cells(i, "E") is empty
.Cells(i, "H") is empty
.Cells(i, "N") is empty
Then
UserForm Label8.Caption = “Update Member Data”
SetFocus on the 1st empty UserFormTextBox
Suggestions?
I wish to use the same UserForm to update Member Data when cells are empty.
Rich (BB code):
Private Sub UserFormAddMembers_Initialize()
Dim i As Long
With Sheets("Members")
For i = 2 To .Cells(Rows.Count, "C").End(xlUp).Row
If .Cells(i, "C").Value = UserFormPost.ComboBox1.Value Then _
'look for empty cells in Members DataBase columns D E F G H N
TextBox1.Value = .Cells(i, "A").Value ’FirstName
TextBox2.Value = .Cells(i, "B").Value ’LastName
TextBox4.Value = .Cells(i, "D").Value ’Ph#
TextBox7.Value = .Cells(i, "E").Value ’email
TextBox8.Value = .Cells(i, "H").Value ’DOB
TextBox11.Value = .Cells(i, "N").Value ’ID
End If
Next i
End With
End Sub
So, I’m struggling with how to best integrate these ideas into the procedure:
If
.Cells(i, "D") is empty
.Cells(i, "E") is empty
.Cells(i, "H") is empty
.Cells(i, "N") is empty
Then
UserForm Label8.Caption = “Update Member Data”
SetFocus on the 1st empty UserFormTextBox
Suggestions?