Brick Transport
New Member
- Joined
- Nov 17, 2017
- Messages
- 22
- Office Version
- 365
- 2021
- Platform
- Windows
- Mobile
- Web
Hi,
Apologies if this has been asked before as I am sure it has (for the life of me I can't find a thread for it). I have a csv file called "import.csv" in the format:
[TABLE="class: grid, width: 500, align: center"]
<colgroup><col style="mso-width-source:userset;mso-width-alt:512;width:11pt" width="14"> <col style="mso-width-source:userset;mso-width-alt:1353;width:28pt" width="37"> <col style="mso-width-source:userset;mso-width-alt:1901;width:39pt" width="52"> <col style="mso-width-source:userset;mso-width-alt:2194;width:45pt" width="60"> <col style="mso-width-source:userset;mso-width-alt:2267;width:47pt" width="62"> <col style="mso-width-source:userset;mso-width-alt:1316;width:27pt" width="36"> <col style="mso-width-source:userset;mso-width-alt:2816;width:58pt" width="77"> <col style="mso-width-source:userset;mso-width-alt:2377;width:49pt" width="65"> <col style="mso-width-source:userset;mso-width-alt:3035;width:62pt" width="83"> <col style="mso-width-source:userset;mso-width-alt:2304;width:47pt" width="63"> <col style="mso-width-source:userset;mso-width-alt:2962;width:61pt" width="81"> </colgroup><tbody>[TR]
[TD="width: 14"][/TD]
[TD="width: 37"]A[/TD]
[TD="width: 52"]B[/TD]
[TD="width: 60"]C[/TD]
[TD="width: 62"]D[/TD]
[TD="width: 36"]E[/TD]
[TD="width: 77"]F[/TD]
[TD="width: 65"]G[/TD]
[TD="width: 83"]H
[/TD]
[TD="width: 63"]I[/TD]
[TD="width: 81"]J[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Type[/TD]
[TD]A/c Ref[/TD]
[TD]Nominal[/TD]
[TD]<BLANK>[/TD]
[TD]Date[/TD]
[TD]Invoice No.[/TD]
[TD]Narrative[/TD]
[TD]Net Amount[/TD]
[TD]Tax Code[/TD]
[TD]Tax Amount
[/TD]
[/TR]
</tbody>[/TABLE]
And I would like to create a macro to open this csv, manipulate the information and create a secondary csv, "4153/SCHEDULE.csv" in the format:
[TABLE="class: grid, width: 500, align: center"]
<colgroup><col style="mso-width-source:userset;mso-width-alt:2048;width:42pt" width="56"> <col style="mso-width-source:userset;mso-width-alt:1901;width:39pt" width="52"> <col style="mso-width-source:userset;mso-width-alt:2742;width:56pt" width="75"> <col style="mso-width-source:userset;mso-width-alt:1792;width:37pt" width="49"> <col style="mso-width-source:userset;mso-width-alt:3474;width:71pt" width="95"> </colgroup><tbody>[TR]
[TD="width: 56"][/TD]
[TD="width: 52"]A
[/TD]
[TD="width: 75"]B
[/TD]
[TD="width: 49"]C
[/TD]
[TD="width: 95"]D
[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]A/c Ref[/TD]
[TD]Invoice No[/TD]
[TD]Date[/TD]
[TD]Gross Amount
[/TD]
[/TR]
</tbody>[/TABLE]
both csv files are located in the same folder: C:\Users\User\xxxxxxxx\documents\Work
Being new to this I would like to know:
1. Where do you create the macro in the first place - a new workbook or within one of the original two?
2. What would be the code I'd need?
3. Could it be created so that all that's required would be to press a button and off it goes to do it's stuff - you know like a dialog box or something?
Thanks in advance!!
Bruce
Apologies if this has been asked before as I am sure it has (for the life of me I can't find a thread for it). I have a csv file called "import.csv" in the format:
[TABLE="class: grid, width: 500, align: center"]
<colgroup><col style="mso-width-source:userset;mso-width-alt:512;width:11pt" width="14"> <col style="mso-width-source:userset;mso-width-alt:1353;width:28pt" width="37"> <col style="mso-width-source:userset;mso-width-alt:1901;width:39pt" width="52"> <col style="mso-width-source:userset;mso-width-alt:2194;width:45pt" width="60"> <col style="mso-width-source:userset;mso-width-alt:2267;width:47pt" width="62"> <col style="mso-width-source:userset;mso-width-alt:1316;width:27pt" width="36"> <col style="mso-width-source:userset;mso-width-alt:2816;width:58pt" width="77"> <col style="mso-width-source:userset;mso-width-alt:2377;width:49pt" width="65"> <col style="mso-width-source:userset;mso-width-alt:3035;width:62pt" width="83"> <col style="mso-width-source:userset;mso-width-alt:2304;width:47pt" width="63"> <col style="mso-width-source:userset;mso-width-alt:2962;width:61pt" width="81"> </colgroup><tbody>[TR]
[TD="width: 14"][/TD]
[TD="width: 37"]A[/TD]
[TD="width: 52"]B[/TD]
[TD="width: 60"]C[/TD]
[TD="width: 62"]D[/TD]
[TD="width: 36"]E[/TD]
[TD="width: 77"]F[/TD]
[TD="width: 65"]G[/TD]
[TD="width: 83"]H
[/TD]
[TD="width: 63"]I[/TD]
[TD="width: 81"]J[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Type[/TD]
[TD]A/c Ref[/TD]
[TD]Nominal[/TD]
[TD]<BLANK>[/TD]
[TD]Date[/TD]
[TD]Invoice No.[/TD]
[TD]Narrative[/TD]
[TD]Net Amount[/TD]
[TD]Tax Code[/TD]
[TD]Tax Amount
[/TD]
[/TR]
</tbody>[/TABLE]
And I would like to create a macro to open this csv, manipulate the information and create a secondary csv, "4153/SCHEDULE.csv" in the format:
[TABLE="class: grid, width: 500, align: center"]
<colgroup><col style="mso-width-source:userset;mso-width-alt:2048;width:42pt" width="56"> <col style="mso-width-source:userset;mso-width-alt:1901;width:39pt" width="52"> <col style="mso-width-source:userset;mso-width-alt:2742;width:56pt" width="75"> <col style="mso-width-source:userset;mso-width-alt:1792;width:37pt" width="49"> <col style="mso-width-source:userset;mso-width-alt:3474;width:71pt" width="95"> </colgroup><tbody>[TR]
[TD="width: 56"][/TD]
[TD="width: 52"]A
[/TD]
[TD="width: 75"]B
[/TD]
[TD="width: 49"]C
[/TD]
[TD="width: 95"]D
[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]A/c Ref[/TD]
[TD]Invoice No[/TD]
[TD]Date[/TD]
[TD]Gross Amount
[/TD]
[/TR]
</tbody>[/TABLE]
both csv files are located in the same folder: C:\Users\User\xxxxxxxx\documents\Work
Being new to this I would like to know:
1. Where do you create the macro in the first place - a new workbook or within one of the original two?
2. What would be the code I'd need?
3. Could it be created so that all that's required would be to press a button and off it goes to do it's stuff - you know like a dialog box or something?
Thanks in advance!!
Bruce