Could u help me with formulas in vba?
ColumnLetter = Split(ActiveWorkbook.ActiveSheet.Cells.Find(What:="*", After:=[A1], SearchOrder:=xlByColumns, SearchDirection:=xlPrevious).Cells.Address(1, 0), "$")(0)
Row = ActiveWorkbook.ActiveSheet.Cells.Find(What:="*", After:=[A1], SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row - 1
For i = 6 To Row
var = ActiveSheet.Range("H" & i).value
var2 = ActiveSheet.Range(ColumnLetter & i).value
Range(ColumnLetter & i).Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "=(RC[" & var & "] - RC[" & var2 & "])"
Next i
I would like to substract two values. ColumntLetter - lastColumn Row - lastRow I have problem with last - "ActiveCell.FormulaR1C1 = "=(RC[" & var & "] - RC[" & var2 & "])"