我是excel vba的新手 . 我有网站网址中的数据 . 我需要导入工作簿表 . 我能够创建工作表和导入,而我想导入特定的工作表 .
这一项工作
Sub Test()
Application.DisplayAlerts = False
strURL = "https://www.nseindia.com/products/dynaContent/equities/equities/histscrip.jsp?symbolCode=1693&symbol=AXISBANK&symbol=axisbank&segmentLink=17&symbolCount=1&series=ALL&dateRange=1month&fromDate=&toDate=&dataType=PRICEVOLUMEDELIVERABLE"
Application.Workbooks.Open (strURL)
Application.DisplayAlerts = True
End Sub
但是,修改代码后无效 . 任何帮助将非常感激 .
Sub OpenCSV()
Application.DisplayAlerts = False
strURL = "https://www.nseindia.com/products/dynaContent/equities/equities/histscrip.jsp?symbolCode=1693&symbol=AXISBANK&symbol=axisbank&segmentLink=17&symbolCount=1&series=ALL&dateRange=1month&fromDate=&toDate=&dataType=PRICEVOLUMEDELIVERABLE"
Worksheets("dump").Range("A1").Select
With Selection
.Open (strURL)
End With
Application.DisplayAlerts = True
End Sub
1 回答
使用查询表并指定目标工作表和范围 .