FoRmEd
Board Regular
- Joined
- Jan 29, 2011
- Messages
- 72
The code shown below is meant to take info from a textbox on a userform and enter it on the next clear cell in a Range, the Range is column B from 3:43, and then, if those are full, it moves to column I and uses that Range from 3:43. I found this code and changed it to work with mine but it doesnt work...at all. Any education would be appreciated.
Rich (BB code):
Dim i As Long, MTRow As Long
i = 3
With Sheets("PHZ1")
Do
i = i + 1
If WorksheetFunction.CountA(Rows(i)) = 0 Then
MTRow = b & i
Exit Do
End If
Loop
End With
Range("B" & MTRow).Offset(5, 0).Select
Me.textCIS.Copy
Sheets("PHZ1").Activate
ActiveSheet.Paste
'copy the data to the database
If Me.optCLSD Then
PHZ1.Cells(RowNum, 3) = "1"
Else
PHZ1.Cells(RowNum, 3) = ""
End If
If Me.optAddt Then
PHZ1.Cells(RowNum, 4) = "1"
Else
PHZ1.Cells(RowNum, 4) = ""
End If
If Me.optRoute Then
PHZ1.Cells(RowNum, 5) = "1"
Else
PHZ1.Cells(RowNum, 5) = ""
End If
If Me.optFLIP Then
PHZ1.Cells(RowNum, 6) = "1"
Else
PHZ1.Cells(RowNum, 6) = ""
End If