Don't Copy If Null --> Help

  • Thread starter Thread starter Ardy
  • Start date Start date
A

Ardy

I have generated a code with help of macro's that will select a range
and then Auto fills it to a given range. It all works fine with one
exception. What I really like to do is stop copying the formula if
there is no values in Column A, in other word do copy until cell in
Column A is Null, Starting from A3.

Range("C2:BL2").Select
Selection.AutoFill Destination:=Range("C2:BL43"),
Type:=xlFillDefault
Range("C2:BL43").Select

A B C D E F Etc ----------->
1 NAME Formula Formula Formula
2 Name


Ardy
 
Can you start at the bottom of column A and come up to find that last used cell?

dim LastRow as long
with activesheet
lastrow = .cells(.rows.count,"A").end(xlup).row
.range("c2:bl2").autofill destination:=.range("c2:bl" & lastrow), _
type:=xlfilldefault
end with
 
Peter:

The Problem is that I am inserting the first row of the formula to
transfer some data points from other Tabs to C2:BL2 , Then Copying via
Auto fill from C3:BL3 until I see a Null in Column A Starting from A3,
So I really need to start from top until I see Null In Column A then
Stop

Sorry I responded late X-mas Stuff.....

Ardy
 
Peter:
I am Sorry...... IIt works just as same from the bottom, I didn't
think It Would. This was so Easy...
 
Back
Top