doriannjeshi
Active Member
- Joined
- Apr 5, 2015
- Messages
- 337
- Office Version
- 365
- Platform
- Windows
Hi,
I need to insert a formula in the last dynamic column in row 2, of a range that starts at A1.
This is what I have static but I need it dynamic last column:
ActiveCell.FormulaR1C1 = "shuma"
Range("AY2").Select
Application.CutCopyMode = False
Selection.FormulaR1C1 = "=SUM(RC[-35]:RC[-1])"
Selection.AutoFill Destination:=Range("AY2:AY" & Range("a" & Rows.Count).End(xlUp).Row)
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
I need to insert a formula in the last dynamic column in row 2, of a range that starts at A1.
This is what I have static but I need it dynamic last column:
ActiveCell.FormulaR1C1 = "shuma"
Range("AY2").Select
Application.CutCopyMode = False
Selection.FormulaR1C1 = "=SUM(RC[-35]:RC[-1])"
Selection.AutoFill Destination:=Range("AY2:AY" & Range("a" & Rows.Count).End(xlUp).Row)
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False