L
Legacy 169354
Guest
Hi everyone,
I managed to clown my way to this code to enter values from a form I made. It enters the values in the cells fine but I have some questions:
1) The worksheet starts at A4 but the code below starts it in A6. How can I change this.
2) Also, I need code to check if the line/row is empty before the form data is entered. If it is not empty then it needs to find the next empty row and print it there. This needs to happen for every time the submit button is pressed!
3) I also need code to check the previous entriy into the worksheet and see if it is identical. if it is a msgbox needs to come up advising before being entered onto a new line (and having the option to cancel the submit and return to the form).
Thanks!!!!!!!!!!
I managed to clown my way to this code to enter values from a form I made. It enters the values in the cells fine but I have some questions:
1) The worksheet starts at A4 but the code below starts it in A6. How can I change this.
2) Also, I need code to check if the line/row is empty before the form data is entered. If it is not empty then it needs to find the next empty row and print it there. This needs to happen for every time the submit button is pressed!
3) I also need code to check the previous entriy into the worksheet and see if it is identical. if it is a msgbox needs to come up advising before being entered onto a new line (and having the option to cancel the submit and return to the form).
Thanks!!!!!!!!!!
'write data to worksheet
RowCount = Worksheets("Data0").Range("A4").CurrentRegion.Rows.Count
With Worksheets("Data0").Range("A4")
.Offset(RowCount, 0).Value = Me.txt_refnum.Value
.Offset(RowCount, 1).Value = DateValue(Me.txt_date.Value)
.Offset(RowCount, 2).Value = Me.txt_time.Value
.Offset(RowCount, 3).Value = Me.txt_port.Value
.Offset(RowCount, 4).Value = Me.Combo_phase_flt.Value
.Offset(RowCount, 5).Value = Me.Combo_species.Value
.Offset(RowCount, 6).Value = Me.Combo_effect.Value
End With