Thanks, Jacob, but didn't work correctly. here is my complete code I'm using.


Posted by Cliff on January 15, 2002 8:46 PM

Here is the code I'm using-
'Make sure sheet is active
Sheets("Week 1").Activate

'Check for next empty row
NextRow = _ (this is supposed to set the starting row)

Application.WorksheetFunction.CountA (Range("A:A")) + 1 (this is supposed to find the first empty row, but it needs to start at row 9, but it starts at row 1)

the rest below does what it should except for starting in the wrong row.
'Transfer Data
Cells(NextRow, 2) = AccountName.Text

If Check500 Then Cells(NextRow, 7) = TextBox500.Value
If Check510 Then Cells(NextRow, 9) = TextBox510.Value
If Check610 Then Cells(NextRow, 10) = TextBox610.Value
If Check612 Then Cells(NextRow, 11) = TextBox612.Value
If Check613 Then Cells(NextRow, 12) = TextBox613.Value
If Check617 Then Cells(NextRow, 13) = TextBox617.Value
If Check624 Then Cells(NextRow, 14) = TextBox624.Value
If Check614 Then Cells(NextRow, 15) = TextBox614.Value
Cells(NextRow, 16) = TextBoxother.Text
Cells(NextRow, 17) = TextBoxotherdollars.Text
Cells(NextRow, 18) = TextBoxdiscription.Text
Cells(NextRow, 21) = TextBoxinitials.Text

'Clear the controls for the next entry
AccountName.Text = ""
Check500 = False
Check510 = False
Check610 = False
Check612 = False
Check613 = False
Check617 = False
Check624 = False
Check614 = False
TextBox500.Value = ""
TextBox510.Value = ""
TextBox610.Value = ""
TextBox612.Value = ""
TextBox613.Value = ""
TextBox617.Value = ""
TextBox624.Value = ""
TextBox614.Value = ""
TextBoxother.Text = ""
TextBoxotherdollars.Text = ""
TextBoxdiscription.Text = ""
TextBoxinitials.Text = ""
AccountName.SetFocus
I need to set NextRow to "A:9" so the rest of the formula will input into NextRow, 2 and so on, and for continued data entry I need for NextRow to advance down one row at the beginning of the code.

Thanks,



Posted by Jacob on January 15, 2002 8:58 PM

Hi

Try this

LastRow = Range("A65536").End(xlup).Offset(1,0).Row

if lastrow < 9 then
lastrow = 9
else
end if

This will set the last row to 9 for the first row then eerything should work fine

HTH

Jacob