Restructure data table in specific upload format

vaibhav106

New Member
Joined
Jan 28, 2009
Messages
40
Hello experts,
I do a daily routine to convert a data table in a specific format which can be than use to upload that data in ERP. I know that Excel macros could be great help here. I have tried to record macro for this process but it doesn't work as per expectation.

I request you to help me here. Can you give me a macro code which can be used to convert data as per expected output. I am sharing source file & expected output file for your easy understanding. This a entry data with header & line record which should be uploaded in ERP system.

Source Table: -
JRNCOMPANYCODEJRNDOCUMENTTYPEJRNDOCUMENTDATEJRNPOSTINGDATEJRNREFERENCEJRNDOCUMENTHEADERTEXTJRNCURRENCYJRNEXCHANGERATEJRNLPOSTINGKEYJRNLACCOUNTJRNLAMOUNTJRNLSPECIALINDICATORJRNLTAXCODEJRNLASSIGNMENTJRNLLONGTEXTJRNLCOSTCENTERJRNLINTERNALORDERJRNLBASELINEDATEJRNLTERMSOFPAYMENTJRNLPROFITCENTERJRNLREFERENCEKEY1JRNLREFERENCEKEY2JRNLREFERENCEKEY3JRNLBUSINESSPLACEJRNLSECTIONCODEJRNLSEGMENTJRNLHSNSACCODEJRNLCREDITCONTROLAREA
Record TypeCompany Code*Document Type*Document Date*Posting Date*Reference*Document Header Text*Currency*Exchange ratePosting Key*Account*Amount*Special G/L ind.Tax codeAssignment*Item Text*Cost CenterInternal OrderBaseline Payment DateTerms of PaymentProfit Center*Reference Key 1Reference Key 2Reference Key 3Business PlaceSection CodeSegmentHSN/SAC CodeCredit Control Area
11000B106.12.202231.12.2022MH37133005641800000533INR4050102165,46,120.34PLNTCP08180000053310LBD1000110LBD01HP01HP01CORPORATE
11000B106.12.202231.12.2022MH37133005641800000533INR40234044998,301.66PLNTCP08180000053310LBD1000110LBD01HP01HP01CORPORATE
11000B106.12.202231.12.2022MH37133005641800000533INR31PLNTCP086,44,422.00PLNTCP08180000053310LBD1000110LBD01HP01HP01CORPORATE
21000B106.12.202231.12.2022MH37133005651800000534INR4050102161,09,223.73PLNTCP08180000053410LBD1000110LBD01HP01HP01CORPORATE
21000B106.12.202231.12.2022MH37133005651800000534INR40234044919,660.27PLNTCP08180000053410LBD1000110LBD01HP01HP01CORPORATE
21000B106.12.202231.12.2022MH37133005651800000534INR31PLNTCP081,28,884.00PLNTCP08180000053410LBD1000110LBD01HP01HP01CORPORATE
201000B131.12.202231.12.2022MH37133006141800000582INR4050102162,82,755.00PLNTCP08180000058210MI10440110MI104MP02MP02CORPORATE
201000B131.12.202231.12.2022MH37133006141800000582INR31PLNTCP082,82,755.00PLNTCP08180000058210MI10440110MI104MP02MP02CORPORATE
211000B131.12.202231.12.2022MH37133006411800000606INR4050102164,339.84PLNTCP08180000060610MP30550110MP305MH01MH01CORPORATE
211000B131.12.202231.12.2022MH37133006411800000606INR402340449781.17PLNTCP08180000060610MP30550110MP305MH01MH01CORPORATE
211000B131.12.202231.12.2022MH37133006411800000606INR31PLNTCP085,121.01PLNTCP08180000060610MP30550110MP305MH01MH01CORPORATE


Expected output: -

JRNCOMPANYCODEJRNDOCUMENTTYPEJRNDOCUMENTDATEJRNPOSTINGDATEJRNREFERENCEJRNDOCUMENTHEADERTEXTJRNCURRENCYJRNEXCHANGERATEJRNLPOSTINGKEYJRNLACCOUNTJRNLAMOUNTJRNLSPECIALINDICATORJRNLTAXCODEJRNLASSIGNMENTJRNLLONGTEXTJRNLCOSTCENTERJRNLINTERNALORDERJRNLBASELINEDATEJRNLTERMSOFPAYMENTJRNLPROFITCENTERJRNLREFERENCEKEY1JRNLREFERENCEKEY2JRNLREFERENCEKEY3JRNLBUSINESSPLACEJRNLSECTIONCODEJRNLSEGMENTJRNLHSNSACCODEJRNLCREDITCONTROLAREA
Record TypeCompany Code*Document Type*Document Date*Posting Date*Reference*Document Header Text*Currency*Exchange ratePosting Key*Account*Amount*Special G/L ind.Tax codeAssignment*Item Text*Cost CenterInternal OrderBaseline Payment DateTerms of PaymentProfit Center*Reference Key 1Reference Key 2Reference Key 3Business PlaceSection CodeSegmentHSN/SAC CodeCredit Control Area
H1000B106/12/202231/12/2022MH37133005641800000533INR
L4050102165,46,120.34PLNTCP08180000053310LBD1000110LBD01HP01HP01CORPORATE
L40234044998,301.66PLNTCP08180000053310LBD1000110LBD01HP01HP01CORPORATE
L31PLNTCP086,44,422.00PLNTCP08180000053310LBD1000110LBD01HP01HP01CORPORATE
H1000B106/12/202231/12/2022MH37133005651800000534INR
L4050102161,09,223.73PLNTCP08180000053410LBD1000110LBD01HP01HP01CORPORATE
L40234044919,660.27PLNTCP08180000053410LBD1000110LBD01HP01HP01CORPORATE
L31PLNTCP081,28,884.00PLNTCP08180000053410LBD1000110LBD01HP01HP01CORPORATE
H1000B131/12/202231/12/2022MH37133006141800000582INR
L4050102162,82,755.00PLNTCP08180000058210MI10440110MI104MP02MP02CORPORATE
L31PLNTCP082,82,755.00PLNTCP08180000058210MI10440110MI104MP02MP02CORPORATE
H1000B131/12/202231/12/2022MH37133006411800000606INR
L4050102164,339.84PLNTCP08180000060610MP30550110MP305MH01MH01CORPORATE
L402340449781.17PLNTCP08180000060610MP30550110MP305MH01MH01CORPORATE
L31PLNTCP085,121.01PLNTCP08180000060610MP30550110MP305MH01MH01CORPORATE
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).

Forum statistics

Threads
1,223,911
Messages
6,175,327
Members
452,635
Latest member
laura12345

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