PDA

View Full Version : Solved: Enter the next consecutive number



av8tordude
02-01-2011, 08:23 AM
I have this code below that enters items in a "Expense" table. Each entry should be numbered consecutively when entered. Can some assist me in the first line of code that will enter the next consecutive number. Keep in mind, the code should be able to start at 1, if the table is empty.

Range("Expense").Cells(Table, 1) =
Range("Expense").Cells(Table, 2) = CDate(Me.Date5)
Range("Expense").Cells(Table, 3) = cboCat.Value
Range("Expense").Cells(Table, 4) = cboDesc.Value
Range("Expense").Cells(Table, 5) = CCur(Replace(Me.Amnt, "$", ""))


Thank you for your help

mancubus
02-01-2011, 09:00 AM
this is what i used for incrementing record id's in column A by 1.


wks.Cells(LastRow, 1).Value = Application.Max(wks.Range("A:A")) + 1

av8tordude
02-01-2011, 09:06 AM
with a few tweeks, it works like a charm...thank you:beerchug:

mancubus
02-01-2011, 09:11 AM
with a few tweeks, it works like a charm...thank you:beerchug:

glad it helped.

:beerchug: