variables in last cell

J

josh

this one is a little bit different this time,

i need to output a variable from vba to the next
available cell in a column in my worksheet, any help
would be much appreciated.

thanks guys
Josh
 
B

Bob Phillips

Josh,

Cells(Rows.Count, "A").End(xlUp).Offset(1, 0).Value = myVar

puts it in the next available cell in column A
 
T

Tom Ogilvy

var = 21

set rng = Cells(rows.count,1).End(xlup)(2)

rng.Value = var


Change the 1 in Cells( ,1) to the column where you want the value.

Regards,
Tom Ogilvy
 

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