I'm trying to copy a formula from a range in column F and paste into each column to the last column in the range.
When pasting to the range, copy cells are only pasted to column F instead of the selected range.
Code:
Dim lastrow As Long
Dim lastcol As Long
Dim i As Long
Range("f2:f" & lastrow).Select
Selection.Copy
lastcol = Cells(6, Columns.Count).End(xlToLeft).Column
Range("f2:f" & lastrow).Select
With ActiveCell
.Resize(lastrow, lastcol - 6).Select
End With
Selection.PasteSpecial xlPasteFormulas
On Error Resume Nextsomewhere in your code? What is the value oflastrow? - Vityata