hello all,
i need your help in excel vba, Actually i've downloaded Tracking report of my SPO and this report is on 4-5 csv files (1 file per week). I have to gather data from these 4 files into one Worksheet. I have to do this with command button on my worksheet; with Open file dialogue box (i want to locate the csv files).
CSV files are something like that (I need only first 4 columns):
<table style="font-family:Arial,Arial; font-size:10pt; background-color:#ffffff; padding-left:2pt; padding-right:2pt; " border="1" cellpadding="0" cellspacing="0"> <colgroup><col style="font-weight:bold; width:30px; "><col style="width:97px;"><col style="width:100px;"><col style="width:141px;"><col style="width:273px;"><col style="width:113px;"></colgroup><tbody><tr style="background-color:#cacaca; text-align:center; font-weight:bold; font-size:8pt; "><td>
</td><td>A</td><td>B</td><td>C</td><td>D</td><td>E</td></tr><tr style="height:17px ;"><td style="font-size:8pt; background-color:#cacaca; text-align:center; ">1</td><td>Name</td><td> MSISDN</td><td> Date</td><td> Location</td><td> MapLink </td></tr><tr style="height:17px ;"><td style="font-size:8pt; background-color:#cacaca; text-align:center; ">2</td><td>M. Younus Safi</td><td> "923***550577"</td><td> "2011-10-07 20:36:18"</td><td> "ACB Tower Badragah Chakwal. Badraga"</td><td> "http://asdf.com" </td></tr><tr style="height:17px ;"><td style="font-size:8pt; background-color:#cacaca; text-align:center; ">3</td><td>M. Younus Safi</td><td> "923***550577"</td><td> "2011-10-07 19:36:26"</td><td> "ACB Tower Badragah Chakwal. Badraga"</td><td> "http://asdf.com" </td></tr><tr style="height:17px ;"><td style="font-size:8pt; background-color:#cacaca; text-align:center; ">4</td><td>M. Younus Safi</td><td> "923***550577"</td><td> "2011-10-07 16:39:58"</td><td> "ACB Tower Badragah Chakwal. Badraga"</td><td> "http://asdf.com" </td></tr><tr style="height:17px ;"><td style="font-size:8pt; background-color:#cacaca; text-align:center; ">5</td><td>M. Younus Safi</td><td> "923***550577"</td><td> "2011-10-07 15:37:23"</td><td> "ACB Tower Badragah Chakwal. Badraga"</td><td> "http://asdf.com" </td></tr><tr style="height:17px ;"><td style="font-size:8pt; background-color:#cacaca; text-align:center; ">6</td><td>M. Younus Safi</td><td> "923***550577"</td><td> "2011-10-07 14:37:05"</td><td> "ACB Tower Badragah Chakwal. Badraga"</td><td> "http://asdf.com" </td></tr></tbody></table>
and my Worksheet is like that (With a command Button):
I want to import first 3 columns of csv file on first 3 columns on my worksheet; leave 2 columns blank and then import the 4th column... now for example i have done importing data from 1st csv file and the data is on 50 rows.. i click the command button again, locate the 2nd csv file.. do the same thing (import 1st 3 columns, 2 blank, then 4th) --from 51st Row-- and so on... hope u understand..
<table style="font-family:Arial,Arial; font-size:10pt; background-color:#ffffff; padding-left:2pt; padding-right:2pt; " border="1" cellpadding="0" cellspacing="0"> <colgroup><col style="font-weight:bold; width:30px; "><col style="width:215px;"><col style="width:110px;"><col style="width:110px;"><col style="width:75px;"><col style="width:75px;"><col style="width:355px;"></colgroup><tbody><tr style="background-color:#cacaca; text-align:center; font-weight:bold; font-size:8pt; "><td>
</td><td>A</td><td>B</td><td>C</td><td>D</td><td>E</td><td>F</td></tr><tr style="height:16px ;"><td style="font-size:8pt; background-color:#cacaca; text-align:center; ">1</td><td style="font-weight:bold; text-align:center; ">Name</td><td style="font-weight:bold; text-align:center; ">MSISDN</td><td style="font-weight:bold; text-align:center; "> Dated</td><td style="font-weight:bold; text-align:center; ">Blank</td><td style="font-weight:bold; text-align:center; ">Blank</td><td style="font-weight:bold; text-align:left; "> Location</td></tr><tr style="height:16px ;"><td style="font-size:8pt; background-color:#cacaca; text-align:center; ">2</td><td>
</td><td>
</td><td>
</td><td>
</td><td>
</td><td>
</td></tr><tr style="height:16px ;"><td style="font-size:8pt; background-color:#cacaca; text-align:center; ">3</td><td>
</td><td>
</td><td>
</td><td>
</td><td>
</td><td>
</td></tr><tr style="height:16px ;"><td style="font-size:8pt; background-color:#cacaca; text-align:center; ">4</td><td>
</td><td>
</td><td>
</td><td>
</td><td>
</td><td>
</td></tr><tr style="height:16px ;"><td style="font-size:8pt; background-color:#cacaca; text-align:center; ">5</td><td>
</td><td>
</td><td>
</td><td>
</td><td>
</td><td>
</td></tr><tr style="height:16px ;"><td style="font-size:8pt; background-color:#cacaca; text-align:center; ">6</td><td>
</td><td>
</td><td>
</td><td>
</td><td>
</td><td>
</td></tr><tr style="height:16px ;"><td style="font-size:8pt; background-color:#cacaca; text-align:center; ">7</td><td>
</td><td>
</td><td>
</td><td>
</td><td>
</td><td>
</td></tr></tbody></table>
Can anyone help me? plz..
i need your help in excel vba, Actually i've downloaded Tracking report of my SPO and this report is on 4-5 csv files (1 file per week). I have to gather data from these 4 files into one Worksheet. I have to do this with command button on my worksheet; with Open file dialogue box (i want to locate the csv files).
CSV files are something like that (I need only first 4 columns):
<table style="font-family:Arial,Arial; font-size:10pt; background-color:#ffffff; padding-left:2pt; padding-right:2pt; " border="1" cellpadding="0" cellspacing="0"> <colgroup><col style="font-weight:bold; width:30px; "><col style="width:97px;"><col style="width:100px;"><col style="width:141px;"><col style="width:273px;"><col style="width:113px;"></colgroup><tbody><tr style="background-color:#cacaca; text-align:center; font-weight:bold; font-size:8pt; "><td>
</td><td>A</td><td>B</td><td>C</td><td>D</td><td>E</td></tr><tr style="height:17px ;"><td style="font-size:8pt; background-color:#cacaca; text-align:center; ">1</td><td>Name</td><td> MSISDN</td><td> Date</td><td> Location</td><td> MapLink </td></tr><tr style="height:17px ;"><td style="font-size:8pt; background-color:#cacaca; text-align:center; ">2</td><td>M. Younus Safi</td><td> "923***550577"</td><td> "2011-10-07 20:36:18"</td><td> "ACB Tower Badragah Chakwal. Badraga"</td><td> "http://asdf.com" </td></tr><tr style="height:17px ;"><td style="font-size:8pt; background-color:#cacaca; text-align:center; ">3</td><td>M. Younus Safi</td><td> "923***550577"</td><td> "2011-10-07 19:36:26"</td><td> "ACB Tower Badragah Chakwal. Badraga"</td><td> "http://asdf.com" </td></tr><tr style="height:17px ;"><td style="font-size:8pt; background-color:#cacaca; text-align:center; ">4</td><td>M. Younus Safi</td><td> "923***550577"</td><td> "2011-10-07 16:39:58"</td><td> "ACB Tower Badragah Chakwal. Badraga"</td><td> "http://asdf.com" </td></tr><tr style="height:17px ;"><td style="font-size:8pt; background-color:#cacaca; text-align:center; ">5</td><td>M. Younus Safi</td><td> "923***550577"</td><td> "2011-10-07 15:37:23"</td><td> "ACB Tower Badragah Chakwal. Badraga"</td><td> "http://asdf.com" </td></tr><tr style="height:17px ;"><td style="font-size:8pt; background-color:#cacaca; text-align:center; ">6</td><td>M. Younus Safi</td><td> "923***550577"</td><td> "2011-10-07 14:37:05"</td><td> "ACB Tower Badragah Chakwal. Badraga"</td><td> "http://asdf.com" </td></tr></tbody></table>
and my Worksheet is like that (With a command Button):
I want to import first 3 columns of csv file on first 3 columns on my worksheet; leave 2 columns blank and then import the 4th column... now for example i have done importing data from 1st csv file and the data is on 50 rows.. i click the command button again, locate the 2nd csv file.. do the same thing (import 1st 3 columns, 2 blank, then 4th) --from 51st Row-- and so on... hope u understand..
<table style="font-family:Arial,Arial; font-size:10pt; background-color:#ffffff; padding-left:2pt; padding-right:2pt; " border="1" cellpadding="0" cellspacing="0"> <colgroup><col style="font-weight:bold; width:30px; "><col style="width:215px;"><col style="width:110px;"><col style="width:110px;"><col style="width:75px;"><col style="width:75px;"><col style="width:355px;"></colgroup><tbody><tr style="background-color:#cacaca; text-align:center; font-weight:bold; font-size:8pt; "><td>
</td><td>A</td><td>B</td><td>C</td><td>D</td><td>E</td><td>F</td></tr><tr style="height:16px ;"><td style="font-size:8pt; background-color:#cacaca; text-align:center; ">1</td><td style="font-weight:bold; text-align:center; ">Name</td><td style="font-weight:bold; text-align:center; ">MSISDN</td><td style="font-weight:bold; text-align:center; "> Dated</td><td style="font-weight:bold; text-align:center; ">Blank</td><td style="font-weight:bold; text-align:center; ">Blank</td><td style="font-weight:bold; text-align:left; "> Location</td></tr><tr style="height:16px ;"><td style="font-size:8pt; background-color:#cacaca; text-align:center; ">2</td><td>
</td><td>
</td><td>
</td><td>
</td><td>
</td><td>
</td></tr><tr style="height:16px ;"><td style="font-size:8pt; background-color:#cacaca; text-align:center; ">3</td><td>
</td><td>
</td><td>
</td><td>
</td><td>
</td><td>
</td></tr><tr style="height:16px ;"><td style="font-size:8pt; background-color:#cacaca; text-align:center; ">4</td><td>
</td><td>
</td><td>
</td><td>
</td><td>
</td><td>
</td></tr><tr style="height:16px ;"><td style="font-size:8pt; background-color:#cacaca; text-align:center; ">5</td><td>
</td><td>
</td><td>
</td><td>
</td><td>
</td><td>
</td></tr><tr style="height:16px ;"><td style="font-size:8pt; background-color:#cacaca; text-align:center; ">6</td><td>
</td><td>
</td><td>
</td><td>
</td><td>
</td><td>
</td></tr><tr style="height:16px ;"><td style="font-size:8pt; background-color:#cacaca; text-align:center; ">7</td><td>
</td><td>
</td><td>
</td><td>
</td><td>
</td><td>
</td></tr></tbody></table>
Can anyone help me? plz..