Importing data in different coloums, depending on the time

Mystz0r

New Member
Joined
May 31, 2011
Messages
9
Hey guys,

I really hope someone can help me with this, it's been causing me some headache for quite a time now.

I have an excel sheet which already imports data from an external source (a url). Whenever I click "update", it updates the data - so far, so good. What I want to do now, is automate the process and split it, according to the time.

To illustrate: At exactly 13:00:00 (roman time), it should update the data and retrieve one of the numbers in the data. As soon as this is retrieved, the number should "lock in", so it won't change when I hit update again.

At 13:01:00 it should once again update the data, and plot in the appropriate number. At 13:02:00 it should repeat itself, and so on and so forth. My end goal is to set up a graf that automatically updates as time goes by, with the given number from my data collection.

I'm not adapt at coding or VBA or whatever in excel, so please take babysteps if that's my solution.

Thanks in advance,

Soren
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
I think the easiest way to do this would be to import the data into the same place every time and then copy/pastespecial values into the appropriate place in the graph. You could figure out where to paste the data by finding the last item you just pasted and using offset to move across 1 row/column as necessary.
 
Upvote 0
Code:
[COLOR="Blue"]Private[/COLOR] iMinute [COLOR="Blue"]As[/COLOR] [COLOR="Blue"]Integer[/COLOR]
[COLOR="Blue"]Private[/COLOR] iHour [COLOR="Blue"]As[/COLOR] [COLOR="Blue"]Integer[/COLOR]

[COLOR="Blue"]Sub[/COLOR] ParentSub()
    [COLOR="Blue"]If[/COLOR] iHour = 0 [COLOR="Blue"]Then[/COLOR] iHour = 13
    [COLOR="Blue"]If[/COLOR] iMinute = 60 [COLOR="Blue"]Then[/COLOR]
        iMinute = 0
        iHour = iHour + 1
    [COLOR="Blue"]End[/COLOR] [COLOR="Blue"]If[/COLOR]
    Application.OnTime [COLOR="Blue"]Date[/COLOR] + TimeSerial(iHour, iMinute, 0), "ChildSub"
[COLOR="Blue"]End[/COLOR] [COLOR="Blue"]Sub[/COLOR]

[COLOR="Blue"]Sub[/COLOR] ChildSub()
[COLOR="Green"]    ' Some actions...[/COLOR]
    iMinute = iMinute + 1
    [COLOR="Blue"]Call[/COLOR] ParentSub
[COLOR="Blue"]End[/COLOR] [COLOR="Blue"]Sub[/COLOR]
 
Upvote 0

Forum statistics

Threads
1,224,561
Messages
6,179,521
Members
452,923
Latest member
JackiG

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