Excel - 每天从在线xls文件导入数据 [英] Excel - import data from an online xls file daily

查看:178
本文介绍了Excel - 每天从在线xls文件导入数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何从在线 .xls 在线输入数据(例如 http://www.rba.gov.au/statistics/hist-exchange-rates/2010-2013.xls )转换为Excel ?我无法使用From Web数据连接。如果更合适,我可以访问Access。

How do I import data from an online .xls file online (such as http://www.rba.gov.au/statistics/hist-exchange-rates/2010-2013.xls) into Excel? I can't use the "From Web" data connection. I have access to Access if that is more appropriate.

或者,如何使用每日更新网页的数据,并将其保存为每个日期的表格(而不是覆盖前几天的记录)?

Alternately, how can I use the data from a daily updated webpage and have it save the table with the date every time (instead of overwriting previous days' records)?

推荐答案

你尝试过一些简单的事情:

Have you tried something as simple as:

Sub OpenXLSfromURL()
Dim wbMe As Workbook
Dim wsNew As Worksheet
Dim w As Integer 
Dim wbURL As Workbook
Dim url As String

Set wbMe = ThisWorkbook
url = "http://www.rba.gov.au/statistics/hist-exchange-rates/2010-2013.xls"
Set wbURL = Workbooks.Open(url)

'## Add code to copy this data to your workbook and/or manipulate the data...'
w = wbMe.Sheets.Count

'## Add a new worksheet to the end of ThisWorkbook:'
Set wsNew = wbMe.Sheets.Add(After:=wbMe.Sheets(w))

'## Copy & Paste this data in to our new worksheet:'
wbURL.Sheets(1).Cells.Copy Destination:=wsNew.Range("A1")

'## Close the downloaded version which we no longer need:'
wbURL.Close

End Sub

这篇关于Excel - 每天从在线xls文件导入数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆