I have a worksheet which needs to calculate few formulas based on the data available, i have worked on two such formulas but it works fine but i assume, there could be a better way for this. I tried using Multirange but am not able to properly code the syntax.
Sub CalculateSSL()
Dim lastrow As Integer, val
Dim OutputLastRow As Long
Dim Lstrow
Lstrow = ThisWorkbook.Sheets("All Sheet-Data").Cells(Rows.Count, "A").End(xlUp).Row
Worksheets("All Sheet-Data").Activate
'the below forumla calculates the number of sales with greater than 100000
Range("L2").Select
ActiveCell.FormulaR1C1 = "=COUNTIF(RC[1]:RC[8],"">100000"")"
Selection.AutoFill Destination:=Range("L2:L" & Lstrow)
Range("W2").Select
ActiveCell.FormulaR1C1 = "=COUNTIF(RC[1]:RC[8],"">100000"")"
Selection.AutoFill Destination:=Range("W2:W" & Lstrow)
Range("AH2").Select
ActiveCell.FormulaR1C1 = "=COUNTIF(RC[1]:RC[8],"">100000"")"
Selection.AutoFill Destination:=Range("AH2:AH" & Lstrow)
Range("AS2").Select
ActiveCell.FormulaR1C1 = "=COUNTIF(RC[1]:RC[8],"">100000"")"
Selection.AutoFill Destination:=Range("AS2:AS" & Lstrow)
Range("BD2").Select
ActiveCell.FormulaR1C1 = "=COUNTIF(RC[1]:RC[8],"">100000"")"
Selection.AutoFill Destination:=Range("BD2:BD" & Lstrow)
Range("BO2").Select
ActiveCell.FormulaR1C1 = "=COUNTIF(RC[1]:RC[8],"">100000"")"
Selection.AutoFill Destination:=Range("BO2:BO" & Lstrow)
'the below forumla calculates the difference between two specific items
Range("V2").Select
ActiveCell.FormulaR1C1 = "=RC[-1]-RC[-3]"
Range("V2").Select
Selection.AutoFill Destination:=Range("V2:V" & Lstrow)
Range("AG2").Select
ActiveCell.FormulaR1C1 = "=RC[-1]-RC[-3]"
Range("AG2").Select
Selection.AutoFill Destination:=Range("AG2:AG" & Lstrow)
Range("AR2").Select
ActiveCell.FormulaR1C1 = "=RC[-1]-RC[-3]"
Range("AR2").Select
Selection.AutoFill Destination:=Range("AR2:AR" & Lstrow)
Range("BC2").Select
ActiveCell.FormulaR1C1 = "=RC[-1]-RC[-3]"
Range("BC2").Select
Selection.AutoFill Destination:=Range("BC2:BC" & Lstrow)
Range("BN2").Select
ActiveCell.FormulaR1C1 = "=RC[-1]-RC[-3]"
Range("BN2").Select
Selection.AutoFill Destination:=Range("BN2:BN" & Lstrow)
End Sub