SourceRange Property 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