I have a workbook with multiple sheets, and each sheet has the same set of named ranges (IE they are scoped to the sheet, not workbook).
I want to query based on a n
Another late entrance to the party...
I couldn't get any of the responses here to work for the entire sheet, so I made a named range for the whole sheet (select all cells and give them a name - I called them POList) and referred to that thus:
UPDATE [POList] SET..... etc
So no single quotes, no backticks, no $ sign, not even the sheet name.
Having said that, the workbook in question only has the one sheet (which DOES have spaces in the name).
This works using Excel 2002 (!) and the following connection code
Dim cn As ADODB.Connection
Set cn = New ADODB.Connection
With cn
.Provider = "Microsoft.Jet.OLEDB.4.0"
.ConnectionString = "Data Source=C:\Purchase Req No. List.xls; Extended Properties=Excel 8.0;"
.Open
End With
Obviously this won't work for everyone's situation and is a bit of a kludgey workaround, but maybe someone will find it useful...