Ascending data form auto-entry?

  • Thread starter Thread starter lykwid
  • Start date Start date
L

lykwid

Hi,

Is there a way to configure a user data form so that a value is
automatically inserted that is +1 to the value previous to it?

Let me explain...

I have a very large table with 100+ records in it. The first column of
this table is the "ID" column. When I use the form, at the moment I
have to first scroll down and see what the next avaliable ID number is.
I would like this to be automated in the form.

So, say there were 104 records, the form would automatically put the
number 105 in the "ID" box of the form.

Thanks in advance. :)
 
Private Sub Userform_Initialize()
Dim rng as Range
set rng = Cells(rows.count,1).End(xlup)
Textbox1.Text = rng.Value + 1
End Sub
 
Back
Top