macro propagate

  • Thread starter Thread starter ~Alan Rosenberg Miami
  • Start date Start date
A

~Alan Rosenberg Miami

XL-2000
Is there away to have this macro propagate
Like if "C18:C19" is occupied then start +1 row down?

Sub copypast()
' Macro recorded 7/10/2003 by A
Range("A14:L16").Select
Selection.AutoFill Destination:=Range("A14:L19"),
Type:=xlFillDefault
Range("A14:L19").Select
Range("C18:C19").Select
Selection.ClearContents
End Sub
 
well the code says copy and past in the same place
I wnat it to copy and past just below the last lines of information
 
I guess I'm still being dense - what is the "it" you refer to?

If you mean that you would like to AutoFill the last three filled
lines that have data in column C, to the next three lines and then
clear the last two cells in column C, here's one way:

Public Sub CopyPast()
With Cells(Rows.Count, 3).End(xlUp).Offset(-2, -2)
.Resize(3, 12).AutoFill Destination:=.Resize(6, 12)
.Offset(4, 2).Resize(2, 1).ClearContents
End With
End Sub
 
Back
Top