Parameter.SourceRange property (Excel)

Returns a Range object that represents the cell that contains the value of the specified query parameter. Read-only.

Syntax

expression.SourceRange

expression A variable that represents a Parameter object.

Example

This example changes the value of the cell used as the source range for the query.

Set qt = Sheets("sheet1").QueryTables(1) 
Set param1 = qt.Parameters(1) 
Set r = param1.SourceRange 
r.Value = "New York" 
qt.Refresh

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.