Hi All,
I'm a novice user of Excel and have quite a lot of data to sift through and export for use in a statistical programme. I know essentially no VBA so could really use some help, otherwise this will be a very long process to do manually.
In short, I have a number of Excel files that contain inflation data for different years. In each row there is a date (Column A) and three columns of relevant data (Columns F,G,H). I have attached a link to one of these files as an example.
http://www.ons.gov.uk/ons/guide-met...s-and-price-quotes/1996/1996-item-indices.zip
What I would like to do is:
In case this is unclear, here is an example of what I am looking for:
[TABLE="width: 500"]
<tbody>[TR]
[TD]Date (Col A)[/TD]
[TD]Data1 (Col F)[/TD]
[TD]Data2 (Col G)[/TD]
[TD]Data3 (Col H)[/TD]
[/TR]
[TR]
[TD]1996_01[/TD]
[TD]5[/TD]
[TD]2[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]1996_01[/TD]
[TD]7[/TD]
[TD]1[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]1996_01[/TD]
[TD]2[/TD]
[TD]9[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]1996_02[/TD]
[TD]9[/TD]
[TD]8[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]1996_03[/TD]
[TD]4[/TD]
[TD]7[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]1996_05[/TD]
[TD]2[/TD]
[TD]6[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]1996_05[/TD]
[TD]9[/TD]
[TD]5[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]1996_06[/TD]
[TD]7[/TD]
[TD]4[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]1996_07[/TD]
[TD]1[/TD]
[TD]3[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]1996_08[/TD]
[TD]0[/TD]
[TD]2[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]1996_08[/TD]
[TD]4[/TD]
[TD]1[/TD]
[TD]5[/TD]
[/TR]
</tbody>[/TABLE]
I'd like to be able to extract (as an example) all the data from column F that falls between 1996_01 and 1996_04, then save this to a text file with commas separating each value, with the text file to be called "[Name Of Excel File]_Data1_1996_04.txt".
Could anyone give me any ideas about where to start or where to look in order to be able to do this? Or are there any templates I could search for that I could modify relatively easily to do this?
Thank guys!
I'm a novice user of Excel and have quite a lot of data to sift through and export for use in a statistical programme. I know essentially no VBA so could really use some help, otherwise this will be a very long process to do manually.
In short, I have a number of Excel files that contain inflation data for different years. In each row there is a date (Column A) and three columns of relevant data (Columns F,G,H). I have attached a link to one of these files as an example.
http://www.ons.gov.uk/ons/guide-met...s-and-price-quotes/1996/1996-item-indices.zip
What I would like to do is:
- Extract data from, say, Column F, if it's corresponding date in Column A is within a set date range.
- Save this data to a text file with commas after each value.
- If possible, though much less important, name the text file as "[Name of Excel File]_[Column F Heading]_[Latest Date given in range from Column A].txt".
In case this is unclear, here is an example of what I am looking for:
[TABLE="width: 500"]
<tbody>[TR]
[TD]Date (Col A)[/TD]
[TD]Data1 (Col F)[/TD]
[TD]Data2 (Col G)[/TD]
[TD]Data3 (Col H)[/TD]
[/TR]
[TR]
[TD]1996_01[/TD]
[TD]5[/TD]
[TD]2[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]1996_01[/TD]
[TD]7[/TD]
[TD]1[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]1996_01[/TD]
[TD]2[/TD]
[TD]9[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]1996_02[/TD]
[TD]9[/TD]
[TD]8[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]1996_03[/TD]
[TD]4[/TD]
[TD]7[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]1996_05[/TD]
[TD]2[/TD]
[TD]6[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]1996_05[/TD]
[TD]9[/TD]
[TD]5[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]1996_06[/TD]
[TD]7[/TD]
[TD]4[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]1996_07[/TD]
[TD]1[/TD]
[TD]3[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]1996_08[/TD]
[TD]0[/TD]
[TD]2[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]1996_08[/TD]
[TD]4[/TD]
[TD]1[/TD]
[TD]5[/TD]
[/TR]
</tbody>[/TABLE]
I'd like to be able to extract (as an example) all the data from column F that falls between 1996_01 and 1996_04, then save this to a text file with commas separating each value, with the text file to be called "[Name Of Excel File]_Data1_1996_04.txt".
Could anyone give me any ideas about where to start or where to look in order to be able to do this? Or are there any templates I could search for that I could modify relatively easily to do this?
Thank guys!