Unable to query named range on sheet with spaces in name in Excel

前端 未结 5 1552
我寻月下人不归
我寻月下人不归 2021-01-18 14:21

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

5条回答
  •  忘掉有多难
    2021-01-18 14:51

    Below query would work. Just make sure the named range Ingredients exist in sheet With Space. Also save the workbook.

    strQuery = "Select * from [With Spaces$Ingredients]"

    Alternatively you can use below

    strQuery = "Select * from [With" & Chr(32) & "Spaces$Ingredients]"

提交回复
热议问题