Use with statement with worksheet : SUM « Excel « VBA / Excel / Access / Word






Use with statement with worksheet

 
Sub ReferAcrossWorksheets2()
  With Sheets("Sheet1")
    MsgBox WorksheetFunction.Sum(.Range(.Range("A1"), .Range("A10")))
  End With
End Sub

 








Related examples in the same category

1.Enters a value in 10 cells in a column and then sums the values
2.Reference worksheet and range by name