Thread
:
Find last row through a macro
View Single Post
#
2
Posted to microsoft.public.excel.programming
somethinglikeant
external usenet poster
Posts: 94
Find last row through a macro
If I can assume that you have no empty cells between A1 and the 'last
row'
then:-
Sub FillFormulasToLastRow()
[A1].Select
Do Until IsEmpty(ActiveCell)
ActiveCell.Offset(1, 0).Select
Loop
ActiveCell.Offset(-1, 0).Select
qend = ActiveCell.Row
[C1].Copy Range("C2:C" & qend)
End Sub
somethinglikeant
wrote:
I have data in column A. The last row filled is row number 20
I have a formula in cell C1.
I want to detect the last filled row in column A (in this example, it
is row no.20) Once the detection is over, the vba should drag formula
in C1 till C20.
The next day I will paste some more data in column A. After running the
same macro, again the same thing should happen. Detect the NEW last row
number and drag formula from C1 till CXX (XX=NEW last row)
Can anybody help?
Reply With Quote
somethinglikeant
View Public Profile
Find all posts by somethinglikeant