Use a With...End With construct with fully qualified properties : With « Language Basics « VBA / Excel / Access / Word






Use a With...End With construct with fully qualified properties

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

 








Related examples in the same category

1.The With/End With Structure
2.Use nested with statement