You didn't post it all but you want to remove selections whereever possible
lr = Cells(Rows.Count, "c").End(xlUp).Row
With Range("c2:c" & lr)
..FillDown
..Value = .Value 'change formula to value NO overhead
End With
--
Don Guillett
SalesAid Software
(E-Mail Removed)
"FamilyGuy902" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I have recorded an excel Macro. I am trying to paste a function down
> for as many rows that are in my file. However, as shown in the
> following code, it is making reference to cell C2926, which happens to
> be the last row in the file that I used to record the macro. It causes
> my macro to crash if there are a different amount of rows in my file.
>
> Selection.End(xlDown).Select
> Range("C2926").Select
> Range(Selection, Selection.End(xlUp)).Select
> ActiveSheet.Paste
>
> Does anyone know what the proper code should be, or what sequence of
> commands I should do when recording the macro? I thought by doing
> end->down arrow would be the way to go, but I guess not....
>
> Thanks,
> Jason
>