Autofill Down When Text to Left is Not Blank

R

ryguy7272

I am trying to find a way to autofill down, when there is data in the column
to the left. I tried a bunch of things, including the macro recorder, and
can’t get a solution. The macro recorder gave me a result such as:
Selection.AutoFill Destination:=Range("C2:C9")

But my range will change all the time and thus I can’t use this hard-code
reference.

Please offer a suggestion or two…



Regards,
Ryan---
 
D

Dave Peterson

Dim LastRow as long
with activesheet
lastrow = .cells(.rows.count,"B").end(xlup).row
.range("C2").autofill destination:=.range("c2:C" & lastrow)
end with
 
R

ryguy7272

Awesome!! Thanks a bunch!!
Ryan---


--
RyGuy


Dave Peterson said:
Dim LastRow as long
with activesheet
lastrow = .cells(.rows.count,"B").end(xlup).row
.range("C2").autofill destination:=.range("c2:C" & lastrow)
end with
 

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