Hello everyone!
I'm bulk converting a bunch of product content from a spreadsheet into basic HTML and I'm looking for a VBA code that lets me concatenate the product's technical specs including the header each time, but only if the cell isn't empty.
The content will be displayed in lists using <ul> tags, so each spec has to be surrounded by <li> and </li>
Something that works similar to the code from this post https://www.mrexcel.com/forum/excel...der-if-cells-not-blank-range.html#post4579089 would be excellent, except this doesn't concatenate the headers -with- the content below.
So a simplifed example of my spreadsheet looks something like this:
[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD]Spec 1:[/TD]
[TD]Spec 2:[/TD]
[TD]Spec 3:[/TD]
[/TR]
[TR]
[TD]Red[/TD]
[TD][/TD]
[TD]Girls[/TD]
[/TR]
[TR]
[TD]Blue[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]50 cm[/TD]
[TD]Boys[/TD]
[/TR]
[TR]
[TD]Yellow[/TD]
[TD]100 cm[/TD]
[TD]Uni[/TD]
[/TR]
</tbody>[/TABLE]
The amount of rows and columns with specs is variable, but it's not a problem for me to edit the code a little bit to point it to the relevant rows and columns if needed.
What I would like for the code to generate for me in the rows next to the data is:
<li>Spec 1: Red</li> <li>Spec 3: Girls</li>
<li>Spec 1: Blue</li>
<li>Spec 2: 50 cm</li> <li>Spec 3: Boys</li>
<li>Spec 1: Yellow</li> <li>Spec 2: 100 cm</li> <li>Spec 3: Uni</li>
The post I linked to above does about half of this, but sadly I'm not yet savvy enough with VBA to tweak it to use it in this way.
Any help would be greatly appreciated! Thanks so much!
I'm bulk converting a bunch of product content from a spreadsheet into basic HTML and I'm looking for a VBA code that lets me concatenate the product's technical specs including the header each time, but only if the cell isn't empty.
The content will be displayed in lists using <ul> tags, so each spec has to be surrounded by <li> and </li>
Something that works similar to the code from this post https://www.mrexcel.com/forum/excel...der-if-cells-not-blank-range.html#post4579089 would be excellent, except this doesn't concatenate the headers -with- the content below.
So a simplifed example of my spreadsheet looks something like this:
[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD]Spec 1:[/TD]
[TD]Spec 2:[/TD]
[TD]Spec 3:[/TD]
[/TR]
[TR]
[TD]Red[/TD]
[TD][/TD]
[TD]Girls[/TD]
[/TR]
[TR]
[TD]Blue[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]50 cm[/TD]
[TD]Boys[/TD]
[/TR]
[TR]
[TD]Yellow[/TD]
[TD]100 cm[/TD]
[TD]Uni[/TD]
[/TR]
</tbody>[/TABLE]
The amount of rows and columns with specs is variable, but it's not a problem for me to edit the code a little bit to point it to the relevant rows and columns if needed.
What I would like for the code to generate for me in the rows next to the data is:
<li>Spec 1: Red</li> <li>Spec 3: Girls</li>
<li>Spec 1: Blue</li>
<li>Spec 2: 50 cm</li> <li>Spec 3: Boys</li>
<li>Spec 1: Yellow</li> <li>Spec 2: 100 cm</li> <li>Spec 3: Uni</li>
The post I linked to above does about half of this, but sadly I'm not yet savvy enough with VBA to tweak it to use it in this way.
Any help would be greatly appreciated! Thanks so much!