Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to convert data
Hi,
On sheet named AREA has the follow data A B C ASD 22 3 4 BSD 6 7 8 CSD 9 11 8 EFD 16 19 8 GFD 27 27 8 Need to convert the data to the below format and then saved as xml file. Any help with code or direction to where i could get this would be greatly appreciated. Can the code be created to convert a specific range of cells? <data <variable name="AREA" <row <column</column <columnA</column <columnB</column <columnC</column </row <row <columnASD</column <column122</column <column3</column <column4</column </row <row <columnBSD</column <column116</column <column7</column <column8</column </row <row <columnCSD</column <column119</column <column11</column <column8</column </row <row <columnEFD</column <column16</column <column19</column <column8</column </row <row <columnGFD</column <column27</column <column27</column <column8</column </row </variable </data Regards, Sujith |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to convert data
Excel 2003 does it automatically
DAtaXMLExport "Sujith" wrote: Hi, On sheet named AREA has the follow data A B C ASD 22 3 4 BSD 6 7 8 CSD 9 11 8 EFD 16 19 8 GFD 27 27 8 Need to convert the data to the below format and then saved as xml file. Any help with code or direction to where i could get this would be greatly appreciated. Can the code be created to convert a specific range of cells? <data <variable name="AREA" <row <column</column <columnA</column <columnB</column <columnC</column </row <row <columnASD</column <column122</column <column3</column <column4</column </row <row <columnBSD</column <column116</column <column7</column <column8</column </row <row <columnCSD</column <column119</column <column11</column <column8</column </row <row <columnEFD</column <column16</column <column19</column <column8</column </row <row <columnGFD</column <column27</column <column27</column <column8</column </row </variable </data Regards, Sujith |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to convert data
Vacation's Over wrote:
Excel 2003 does it automatically DAtaXMLExport "Sujith" wrote: Hi, On sheet named AREA has the follow data A B C ASD 22 3 4 BSD 6 7 8 CSD 9 11 8 EFD 16 19 8 GFD 27 27 8 Need to convert the data to the below format and then saved as xml file. Any help with code or direction to where i could get this would be greatly appreciated. Can the code be created to convert a specific range of cells? <data <variable name="AREA" <row <column</column <columnA</column <columnB</column <columnC</column </row <row <columnASD</column <column122</column <column3</column <column4</column </row <row <columnBSD</column <column116</column <column7</column <column8</column </row <row <columnCSD</column <column119</column <column11</column <column8</column </row <row <columnEFD</column <column16</column <column19</column <column8</column </row <row <columnGFD</column <column27</column <column27</column <column8</column </row </variable </data Regards, Sujith Thanks, but i am using excel 2002. Can this be achieved in 2002 to get the above. I tried saving the sheet as xml spreadsheet but did not give me the above structure, which is critical. R/, Sujith |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to convert data
Just open a file from vba and write out the XML by looping through the
range. eg (untested - treat as pseudocode) dim rngOut as range,r as row, c as range set rngOut=activesheet.range("A1:C10") 'for example '....open file write the header info to file 'loop through content for each r in rngOut.rows 'print to file "<row" for each c in r.cells 'print to file "<column" & c.value & "</column" next 'print to file "</row" next r Tim "Sujith" wrote in message ... Vacation's Over wrote: Excel 2003 does it automatically DAtaXMLExport "Sujith" wrote: Hi, On sheet named AREA has the follow data A B C ASD 22 3 4 BSD 6 7 8 CSD 9 11 8 EFD 16 19 8 GFD 27 27 8 Need to convert the data to the below format and then saved as xml file. Any help with code or direction to where i could get this would be greatly appreciated. Can the code be created to convert a specific range of cells? <data <variable name="AREA" <row <column</column <columnA</column <columnB</column <columnC</column </row <row <columnASD</column <column122</column <column3</column <column4</column </row <row <columnBSD</column <column116</column <column7</column <column8</column </row <row <columnCSD</column <column119</column <column11</column <column8</column </row <row <columnEFD</column <column16</column <column19</column <column8</column </row <row <columnGFD</column <column27</column <column27</column <column8</column </row </variable </data Regards, Sujith Thanks, but i am using excel 2002. Can this be achieved in 2002 to get the above. I tried saving the sheet as xml spreadsheet but did not give me the above structure, which is critical. R/, Sujith |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to convert data
Tim Williams wrote:
Just open a file from vba and write out the XML by looping through the range. eg (untested - treat as pseudocode) dim rngOut as range,r as row, c as range set rngOut=activesheet.range("A1:C10") 'for example '....open file write the header info to file 'loop through content for each r in rngOut.rows 'print to file "<row" for each c in r.cells 'print to file "<column" & c.value & "</column" next 'print to file "</row" next r Tim thx will try it out Sujith |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
macro to convert excel to PDF | Excel Discussion (Misc queries) | |||
I want to convert word column data to excel row data to sort addre | Excel Discussion (Misc queries) | |||
Convert hhhh:mm:ss to hh:mm:ss (macro ?) | Excel Worksheet Functions | |||
can i convert data copied as an image into data in excel ? | Excel Worksheet Functions | |||
Using Macro to convert 240 to PRN | Excel Programming |