Updating Spreadsheet From Online Source

schmid

New Member
Joined
Jun 29, 2016
Messages
31
Hi I currently have an excel workbook that extracts data from an online excel file. I am new to VBA and the macro I built accesses the master file online and simply copies and pastes everything into my workbook on my first sheet. From there my other sheets access my copy of the master to build the graphs and reports. However my method completely overwrites the data every time I run it and it is extremely time consuming to run thousands of calculations when each update only adds about 3 rows.

Is there any way to write a macro that checks if new rows are available and only copy the rows not already in my file?

This is my current code

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://url where data is stored"

Set wbURL = Workbooks.Open(url)

Sheets("Data").Select
ActiveSheet.Range("$A$1:$AQ$27984").AutoFilter Field:=5, Criteria1:="IP2"
Rows("9:30000").Select
Selection.Copy

Application.DisplayAlerts = False
wbURL.Close False

Sheets("Lab Data").Select
Range("A2").Select
ActiveSheet.Paste
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.

Forum statistics

Threads
1,223,246
Messages
6,170,996
Members
452,373
Latest member
TimReeks

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top