简体   繁体   English

Excel Web 查询:用另一个表中的值替换查询 URL

[英]Excel Web Query: Replace query URL with value from another table

Currently, the colorful table is using a fixed URL.目前,彩色表使用的是固定 URL。 I want to send a user-defined, complete URL string to this web query, and have it update whenever it's changed.我想向这个网络查询发送一个用户定义的、完整的 URL 字符串,并在它发生变化时更新它。

The large white box is a pulldown list (AN358):大白框是一个下拉列表(AN358):

在此处输入图片说明

User can choose a new location:用户可以选择一个新位置:

在此处输入图片说明

Which brings up a new URL (AN362) which points to a different web table (always same format).这会带来一个新的 URL (AN362),它指向一个不同的 web 表(总是相同的格式)。 In my case, the colorful table does not change since it's currently a fixed link.就我而言,彩色表格不会改变,因为它目前是一个固定链接。

To the right, I converted the blue cells into a new table called "TableYear1" (AN361):在右侧,我将蓝色单元格转换为名为“TableYear1”(AN361)的新表:

在此处输入图片说明

In power editor, here is the existing query "Year 1":在 Power Editor 中,这是现有的查询“Year 1”:

在此处输入图片说明

In advanced editor, I tried to replace the web link highlighted here:在高级编辑器中,我尝试替换此处突出显示的 Web 链接:

在此处输入图片说明

With the underlined value here.这里有下划线的值。 I know the syntax/usage is probably wrong...it's just to illustrate what I want to accomplish.我知道语法/用法可能是错误的……这只是为了说明我想要完成的任务。

在此处输入图片说明

try replacing the code with this尝试用这个替换代码

Source = Web.Page(Web.Contents(Excel.CurrentWorkbook(){[Name="TableYear1"]}[Content]{0}[URL1])),

in your example you pass a string (table name), while you need a reference to that table在您的示例中,您传递一个字符串(表名),而您需要对该表的引用

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM