Creating an Xml file in Excel using VBA and loop function - help needed

MrPink1986

Active Member
Joined
May 1, 2012
Messages
252
Hi,

I want to create a XML file in excel. I have created the schema in excel in the correct syntax needed for the XML file. I have my date in column B - Z - column A has some static elements which will be used within the schema.

I want to paste my data which will vary in to columns B-Z and have excel produce the file in column A in a vertical fashion. I have done this for one record however now I am having trouble in how best to replicate this. To be clear my date in columns B-Z in row 2 has been used now I want the data in columns B-Z row 3 to follow the same formulas I have in place for the row above. The formulas are placed in A33 - A66. I want A77 down to have the data from row 3.

I believe a loop of some fashion in VBA would be best here however do not know where to start....



Below are the formulas I am using in column A

Code:
[TABLE="width: 909"]
<colgroup><col></colgroup><tbody>[TR]
[TD]="<"&$A$1&">"[/TD]
[/TR]
[TR]
[TD]="<"&$B$1&">"&B2&"</"&$B$1&">"[/TD]
[/TR]
[TR]
[TD]="<"&$C$1&">"&C2&"</"&$C$1&">"[/TD]
[/TR]
[TR]
[TD]="<"&$D$1&">"&D2&"</"&$D$1&">"[/TD]
[/TR]
[TR]
[TD]="<"&$E$1&">"&E2&"</"&$E$1&">"[/TD]
[/TR]
[TR]
[TD]="<"&$F$1&">"&F2&"</"&$F$1&">"[/TD]
[/TR]
[TR]
[TD]="<"&$G$1&">"&G2&"</"&$G$1&">"[/TD]
[/TR]
[TR]
[TD]="<"&$A$3&">"[/TD]
[/TR]
[TR]
[TD]<Identifier includeInResponse="true" source="Icon">[/TD]
[/TR]
[TR]
[TD]="<"&$A$5&">"&I2&"</"&$A$5&">"[/TD]
[/TR]
[TR]
[TD]="<"&$A$6&">"&J2&"</"&$A$6&">"[/TD]
[/TR]
[TR]
[TD]="</"&$A$4&">"[/TD]
[/TR]
[TR]
[TD]="<"&$A$4&">"[/TD]
[/TR]
[TR]
[TD]="<"&$A$5&">"&M2&"</"&$A$5&">"[/TD]
[/TR]
[TR]
[TD]="<"&$A$6&">"&N2&"</"&$A$6&">"[/TD]
[/TR]
[TR]
[TD]="</"&$A$4&">"[/TD]
[/TR]
[TR]
[TD]="<"&$A$4&">"[/TD]
[/TR]
[TR]
[TD]="<"&$A$5&">"&P2&"</"&$A$5&">"[/TD]
[/TR]
[TR]
[TD]="<"&$A$6&">"&Q2&"</"&$A$6&">"[/TD]
[/TR]
[TR]
[TD]="</"&$A$4&">"[/TD]
[/TR]
[TR]
[TD]="<"&$A$4&">"[/TD]
[/TR]
[TR]
[TD]="<"&$A$5&">"&S2&"</"&$A$5&">"[/TD]
[/TR]
[TR]
[TD]="<"&$A$6&">"&T2&"</"&$A$6&">"[/TD]
[/TR]
[TR]
[TD]="</"&$A$4&">"[/TD]
[/TR]
[TR]
[TD]="<"&$A$4&">"[/TD]
[/TR]
[TR]
[TD]="<"&$A$5&">"&V2&"</"&$A$5&">"[/TD]
[/TR]
[TR]
[TD]="<"&$A$6&">"&W2&"</"&$A$6&">"[/TD]
[/TR]
[TR]
[TD]="</"&$A$4&">"[/TD]
[/TR]
[TR]
[TD]="<"&$A$3&">"[/TD]
[/TR]
[TR]
[TD]="</"&$A$1&">"[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.

Forum statistics

Threads
1,215,325
Messages
6,124,252
Members
449,149
Latest member
mwdbActuary

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