View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
dominicb[_53_] dominicb[_53_] is offline
external usenet poster
 
Posts: 1
Default last cell plus one


Good afternoon ClareFoxly

There is but we'll make a few assumptions as you've not given much
information in your post.

Private Sub UserForm_Initialize()
g = Application.WorksheetFunction.CountA(Range("A:A"))
a = Cells(g, 1)
Label1.Caption = a + 1
End Sub

Paste the code above into your userform's code section. This will look
for the last row in column A and insert the value of the last row + 1
into a label called Label1.
To insert the value into a text box, use this as the second to the last
line:

TextBox1.Value = a + 1

HTH

DominicB


--
dominicb
------------------------------------------------------------------------
dominicb's Profile: http://www.excelforum.com/member.php...o&userid=18932
View this thread: http://www.excelforum.com/showthread...hreadid=384541