Thread: [Solved] Macro to convert data
View Single Post
 
Old 10-16-2015, 12:17 AM
unwantedoz unwantedoz is offline Windows 7 64bit Office 2013
Novice
 
Join Date: Oct 2015
Posts: 2
unwantedoz is on a distinguished road
Default Macro to convert data

Hello, I need help making a macro. I spent an hour or two couple of hours googling how to make macros but I still have no idea how to do what I want to.

Anyway I want display a chart on a website. I will be using fusioncharts.js to make it as trying it I have found it really easy to use.

My problem is the data is not in the format it needs. It needs it in either JSON or XML as a single string format.

Here is an example workbook with the data manually change to how it needs to look bellow it.

So if the data was

Column 1_______Column 2
25/08/2015_____112

I need the two pieces of data in that entry (the 25/08/2015 and the 112) converted to (doesn't matter where on the page it is or if a new sheet etc) an entry which takes up 1 Column & 4 rows being

Column X
{
"label": "23/08/2015",
"value": "78"
},

or into a single cell (including the < and > at the start and end)
<set label='23/08/2015' value='78' />

For the XML type it doesn't matter if each entry is in a separate cell (next to each other, they can not be under each other) or if they are all added together and put into the one cell.
Attached Files
File Type: xls example.xls (37.0 KB, 8 views)
Reply With Quote