I have this code. The formulas in row 4 copy themselves down.
I think this is not running;
Range("c5:bd&(lastrw.value)").Select
What i am trying to do is calculate the results after resize, then paste the results as values. Row 4 is never overwritten, as it contains the formulas.
Thanks
Mark
Sub UpdateCostCalc()
Set ReCalc = ActiveWorkbook.Sheets("Cost")
lastrw = ReCalc.Cells(Rows.Count, "a").End(xlUp).Row
With ReCalc
.Activate
ActiveSheet.Unprotect
.Range("c4:bd4").Copy .Range("c5").Resize(lastrw - 4, 1)
Calculate
Range("c5:bd&(lastrw.value)").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("a1").Select
End With
End Sub
I think this is not running;
Range("c5:bd&(lastrw.value)").Select
What i am trying to do is calculate the results after resize, then paste the results as values. Row 4 is never overwritten, as it contains the formulas.
Thanks
Mark
Sub UpdateCostCalc()
Set ReCalc = ActiveWorkbook.Sheets("Cost")
lastrw = ReCalc.Cells(Rows.Count, "a").End(xlUp).Row
With ReCalc
.Activate
ActiveSheet.Unprotect
.Range("c4:bd4").Copy .Range("c5").Resize(lastrw - 4, 1)
Calculate
Range("c5:bd&(lastrw.value)").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("a1").Select
End With
End Sub