Finding Row

D

Don Guillett

next
nr=cells(activecell.row,activecell.column).end(xldown).row+1
or better yet
lr=cells(rows.count,activecell.column).end(xlup).row+1
 
F

fak119

Do I simply enter this last line into any Macro?

Don Guillett said:
next
nr=cells(activecell.row,activecell.column).end(xldown).row+1
or better yet
lr=cells(rows.count,activecell.column).end(xlup).row+1
 
D

Dave Peterson

Yep. Then you can use it any way you want.

Option Explicit
sub testme()
dim LR as long
with activesheet
lr = .cells(.rows.count,activecell.column).end(xlup).row + 1
.cells(lr,"A").value = "Hi there"
.cells(lr,activecell.column).value = "Bye there"
end with
end sub

Don used the activecell to find the next row. I think I would look at my data
and pick out a column that always has data--say column A:

So the line of code becomes:
lr = .cells(.rows.count,"a").end(xlup).row + 1
 
Top