Copying to a flexible range

J

johncpa

I want to copy a formula using a macro but the ending part of the range can
change. For example, the user inputs the current age and a retirement age
and the retirement age can change. How do I create a macro that can allow
the range to be flexible, i.e. 15 years, 20 years, etc. I can copy the
formula manually to the ending range but I want to be able to have a macro
perform this automatically. Any help would be appreciated.
 
D

Don Guillett

lastrow=cells(rows.count,"a").end(xlup).row
range("b12").copy range("a"&lastrow)
 

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