That is so odd.
I have highlighted in Red the code that References this tab... maybe it will help??
Private Sub CommandButton3_Click()
Dim WS As Worksheet
Set WS = Worksheets("ClientDB")
Dim ns As Worksheet
Set ns = Worksheets("USDS")
Dim dt As Worksheet
Set dt = Worksheets("Data")
'check for edit mode
If UserForm.CommandButton3.Caption <> "Update" Then
newRow = Application.CountA(WS.Range("A:A")) + 2
nsRow = Application.CountA(ns.Range("A:A")) + 2
dtRow = Application.CountA(ns.Range("A:A")) + 1
Else
newRow = EditRow
nsRow = Application.Match(UniqueID, Sheets("USDS").Columns(2), 0)
End If
If UserForm.CommandButton3.Caption = "Update" Then
If Not IsError(nsRow) Then
' ns.Cells(nsRow, 1).NumberFormat = "mm/dd/yyyy"
' ns.Cells(nsRow, 1).Value = Date
ns.Cells(nsRow, 3).Value = TextBox1.Text
ns.Cells(nsRow, 4).Value = TextBox3.Text
End If
End If
If UserForm.CommandButton3.Caption <> "Update" Then
WS.Cells(newRow, 1).NumberFormat = "mm/dd/yyyy"
WS.Cells(newRow, 1).Value = Date
If Not IsError(nsRow) Then
ns.Cells(nsRow, 1).NumberFormat = "mm/dd/yyyy"
ns.Cells(nsRow, 1).Value = Date
ns.Cells(nsRow, 3).Value = TextBox1.Text
ns.Cells(nsRow, 4).Value = TextBox3.Text
dt.Cells(dtRow, 3).Value = TextBox1.Text
End If
End If
WS.Cells(newRow, 2).Value = TextBox1.Text
WS.Cells(newRow, 3).Value = TextBox3.Text
If CheckBox1.Value Then
TextBox2.Value = "Homeless"
TextBox4.Value = "Homeless"
TextBox6.Value = "Homeless"
End If
WS.Cells(newRow, 4).Value = TextBox2.Text
WS.Cells(newRow, 5).Value = TextBox7.Text
WS.Cells(newRow, 6).Value = TextBox4.Text
WS.Cells(newRow, 7).Value = TextBox6.Text
WS.Cells(newRow, 8).Value = Format(TextBox5.Text, "000-000-0000")
I just tried it again, and added "Testing 1" to the form. When it adds the info to the other tabs, it puts it in the correct place.
When it adds it to the "Data" tab it puts the info in row 14 instead of row 6. Before Running the userform, i highlighted from Row 6 Down to the end of the worksheet and cleared all contents just to make sure there was no data in those cells.
Bookmarks