Hey there,
I'm currently stuck on how to do this.
Below is an example of what the worksheet looks like. I have provided what userform1 does and performs the way i want it to.
First row that contains data begins at "4".
Rows 1 through 3 have merged cells, not sure if thought would effect the code, but thought I'd mention it.
I'm trying to create userform2 so that it will enter data to fill the first blank spaces labed "A".
Then next entry using userform2 will fill spaces "B".
In addtion, trying to create userform3 to fill info in columns I and J per entry.
I tried copying code I used in userform1 and changed Range("A:A") to Range("I:I"), but doesn't work.
Any help would be greatly appreciated!
[TABLE="width: 500, align: center"]
<tbody>[TR]
[TD="align: center"]A[/TD]
[TD="align: center"]B[/TD]
[TD="align: center"]C[/TD]
[TD="align: center"]D[/TD]
[TD="align: center"]E[/TD]
[TD="align: center"]F[/TD]
[TD="align: center"]G[/TD]
[TD="align: center"]H[/TD]
[TD="align: center"]I[/TD]
[TD="align: center"]J[/TD]
[/TR]
[TR]
[TD="align: center"]data[/TD]
[TD="align: center"]data[/TD]
[TD="align: center"]data[/TD]
[TD="align: center"]data[/TD]
[TD="align: center"]N[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]data[/TD]
[TD="align: center"]data[/TD]
[TD="align: center"]data[/TD]
[TD="align: center"]data[/TD]
[TD="align: center"]Y[/TD]
[TD="align: center"]"A"[/TD]
[TD="align: center"]"A"[/TD]
[TD="align: center"]"A"[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]data[/TD]
[TD="align: center"]data[/TD]
[TD="align: center"]data[/TD]
[TD="align: center"]data[/TD]
[TD="align: center"]N[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]data[/TD]
[TD="align: center"]data[/TD]
[TD="align: center"]data[/TD]
[TD="align: center"]data[/TD]
[TD="align: center"]N[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]data[/TD]
[TD="align: center"]data[/TD]
[TD="align: center"]data[/TD]
[TD="align: center"]data[/TD]
[TD="align: center"]Y[/TD]
[TD="align: center"]"B"[/TD]
[TD="align: center"]"B"[/TD]
[TD="align: center"]"B"[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]data[/TD]
[TD="align: center"]data[/TD]
[TD="align: center"]data[/TD]
[TD="align: center"]data[/TD]
[TD="align: center"]N[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]data[/TD]
[TD="align: center"]data[/TD]
[TD="align: center"]data[/TD]
[TD="align: center"]data[/TD]
[TD="align: center"]N[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]data[/TD]
[TD="align: center"]data[/TD]
[TD="align: center"]data[/TD]
[TD="align: center"]data[/TD]
[TD="align: center"]N[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
</tbody>[/TABLE]
userform1:
userform3:
Thanks in advance!
I'm currently stuck on how to do this.
Below is an example of what the worksheet looks like. I have provided what userform1 does and performs the way i want it to.
First row that contains data begins at "4".
Rows 1 through 3 have merged cells, not sure if thought would effect the code, but thought I'd mention it.
I'm trying to create userform2 so that it will enter data to fill the first blank spaces labed "A".
Then next entry using userform2 will fill spaces "B".
In addtion, trying to create userform3 to fill info in columns I and J per entry.
I tried copying code I used in userform1 and changed Range("A:A") to Range("I:I"), but doesn't work.
Any help would be greatly appreciated!
[TABLE="width: 500, align: center"]
<tbody>[TR]
[TD="align: center"]A[/TD]
[TD="align: center"]B[/TD]
[TD="align: center"]C[/TD]
[TD="align: center"]D[/TD]
[TD="align: center"]E[/TD]
[TD="align: center"]F[/TD]
[TD="align: center"]G[/TD]
[TD="align: center"]H[/TD]
[TD="align: center"]I[/TD]
[TD="align: center"]J[/TD]
[/TR]
[TR]
[TD="align: center"]data[/TD]
[TD="align: center"]data[/TD]
[TD="align: center"]data[/TD]
[TD="align: center"]data[/TD]
[TD="align: center"]N[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]data[/TD]
[TD="align: center"]data[/TD]
[TD="align: center"]data[/TD]
[TD="align: center"]data[/TD]
[TD="align: center"]Y[/TD]
[TD="align: center"]"A"[/TD]
[TD="align: center"]"A"[/TD]
[TD="align: center"]"A"[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]data[/TD]
[TD="align: center"]data[/TD]
[TD="align: center"]data[/TD]
[TD="align: center"]data[/TD]
[TD="align: center"]N[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]data[/TD]
[TD="align: center"]data[/TD]
[TD="align: center"]data[/TD]
[TD="align: center"]data[/TD]
[TD="align: center"]N[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]data[/TD]
[TD="align: center"]data[/TD]
[TD="align: center"]data[/TD]
[TD="align: center"]data[/TD]
[TD="align: center"]Y[/TD]
[TD="align: center"]"B"[/TD]
[TD="align: center"]"B"[/TD]
[TD="align: center"]"B"[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]data[/TD]
[TD="align: center"]data[/TD]
[TD="align: center"]data[/TD]
[TD="align: center"]data[/TD]
[TD="align: center"]N[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]data[/TD]
[TD="align: center"]data[/TD]
[TD="align: center"]data[/TD]
[TD="align: center"]data[/TD]
[TD="align: center"]N[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]data[/TD]
[TD="align: center"]data[/TD]
[TD="align: center"]data[/TD]
[TD="align: center"]data[/TD]
[TD="align: center"]N[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"]N/A[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
</tbody>[/TABLE]
userform1:
Code:
Private Sub cmdSend_Click()
Dim emptyRow As Long
emptyRow = WorksheetFunction.CountA(Range("A:A")) + 1
Cells(emptyRow, 1).Value = data1.Value
Cells(emptyRow, 2).Value = data2.Value
Cells(emptyRow, 3).Value = data3.Value
Cells(emptyRow, 4).Value = data4.Value
If Cells(emptyRow, 4).Value = Cells(emptyRow - 1, 4) Then
Cells(emptyRow, 5).Value = "N"
Cells(emptyRow, 6).Value = "NA"
Cells(emptyRow, 7).Value = "NA"
Cells(emptyRow, 8).Value = "NA"
End If
If Cells(emptyRow, 4).Value <> Cells(emptyRow - 1, 4) Then
Cells(emptyRow, 5).Value = "Y"
End If
Unload Me
End Sub
userform3:
Code:
Sub cmdSend_Click()
Dim emptyRow As Long
emptyRow = WorksheetFunction.CountA(Range("I:I")) + 1
Cells(emptyRow,9).Value = data1.Value
Cells(emptyRow, 10).Value = data2.Value
Unload Me
End Sub
Thanks in advance!