Creating a Macro to open CSV files and pasting on a sheet.

siow89

New Member
Joined
Jun 16, 2014
Messages
21
Hello,

i was wonder is there was any way I could go to the following website:

https://www.ieso.ca/imoweb/pubs/marketReports/daily/PUB_GenPlan_20140711.csv

and copy paste it into an excel sheet. What i would need is to get this page and the previous 7 days by changing the date "20140711" to "20140710" and so on. Each orevious day needs to be copy pasted to a different sheet.

As a new day occurs, I would like to delete the page 7 days ago and add the new day on a new sheet.
I hope this is clear enough.

Thank you!
 
I have tried it that but it still seem to get "overflow" error...I don't think it is reading it properly
 
Upvote 0

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
have you used the date function to generate your date and then format it? you mustn't enter 20140718 in your cell because these are in reality many many days in the future
 
Upvote 0
it works when using the date function. But is there anyway to not use the date function and just put in the values?

something along the lines:
Const sDateCELL = "A1"
Dim myDate As Date
Dim sDate As String
Dim sYear As String
Dim sMonth As String
Dim sDayOfMonth As String


'Get the date chosen by the User
'Reformat the date to 'yyyymmdd' format
sDate = Trim(Sheets("Date").Range(sDateCELL).Text)
 
Upvote 0
there is

type 2014/07/18

OR type 18 July 2014, excel will understand it is a date
 
Last edited:
Upvote 0
I have to create an excel spreadsheet from a folder that has 7 CSV files. Is there an macro that can do it
I have looked around, but unable to do one or find one
 
Upvote 0
Hi

can you start a new thread with a more detailed description? maybe show what your CSV looks like as well

I have to create an excel spreadsheet from a folder that has 7 CSV files. Is there an macro that can do it
I have looked around, but unable to do one or find one
 
Upvote 0
Hello,

So I have been playing around with your code and have been able to successfully combine it with my macro where i fetch other data. However, I was wondering if it would be possible for a small alteration. I was wondering if it would be possible to have a sheet consistently called "today" and another called "yesterday"...so when you run the today macro it fetch's today's data and pastes it the today sheet and fetch's yesterday's data and pastes it in "yesterday" sheet.

Thank you very much!
 
Upvote 0

Forum statistics

Threads
1,215,517
Messages
6,125,288
Members
449,218
Latest member
Excel Master

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