Using the next reference number automatically

N

Novicer

Can someone please help me to write a macro that can help me access the next
available sequential number (1, 2, 3, 4, etc) from an existing worksheet? For
example, if Rows 1 - 5 already has data entered already, I want to reference
my formulas to Rows 6 (that is avaialbe) automatically. Thanks!
 
P

Per Jessen

Hi

With data in column A, this will return the number of first empty row:

FirstEmptyRow = Range("A1").End(xlDown).Row + 1

Hopes it helps

Regards,
Per
 
B

Barb Reinhardt

Let's say you want to put a formula in the next cell in column A

Dim myWS as WOrksheet
dim myRange as range
Set myWS = activesheet
Set myRange = myWS.cells(myws.rows.count,1).end(xlup).offset(1,0)
myRange.formulaR1C1 = ... put your formula here.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top