excel - 使用 VBA 从 Google 电子表格导入范围
问题描述
我拥有的代码是在 Google 电子表格上导入所有内容,包括行号和列标题。
如何导入特定范围的工作表?
Sub Basic_Web_Query()
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;https://docs.google.com/spreadsheets/d/11H_-UFOpNAtQbs5BNOwZZK1KBew6l-8XKmoMycWuizU/edit?usp=sharing", Destination:=Range("$A$1"))
.Name = "q?s=goog_2"
.FieldNames = False
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = "1"
.WebPreFormattedTextToColumns = False
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
End Sub
解决方案
推荐阅读
- android - Android 旋转文本:我使用 dynamiclayout.draw(canvas) 但它不会沿路径设置动画,并且不能使用 canvas.drawTextOnPath(dynamiclayout)
- list - 将列表的第一项添加到其他列表 Python 的前面
- mongodb - mongodb 从属“身份验证失败”
- android - 从片段后台堆栈中的特定位置删除和导航片段
- android - Unity 2019.3 作业失败并出现异常:GooglePlayServices.JavaUtilities+ToolNotFoundException:找不到 jar
- python - groupby 后聚合列的组合
- debugging - Toad 调试器不进入程序
- python - 如何使用 subprocess 和 os 模块在终端(mac os)中运行命令?
- javascript - 是否有可能从函数本身内部获得异步函数的承诺?
- android - 扫描打开应用程序时如何在 Android 上使用 NFC 标签