Extracting Data from Rows using a Macro(s)

A17BPG

New Member
Joined
Oct 4, 2016
Messages
20
Below is sample of what my spreadsheet may look like:
[TABLE="class: cms_table, width: 30"]
<tbody>[TR]
[TD]Name[/TD]
[TD]Tel.#[/TD]
[TD]PoultryReq[/TD]
[TD]Wght.[/TD]
[TD]PorkReq.[/TD]
[TD]Wght.[/TD]
[TD]BeefReq.[/TD]
[TD]Wght.[/TD]
[TD]Bacon[/TD]
[TD]Wght.[/TD]
[/TR]
[TR]
[TD]Fred[/TD]
[TD]123[/TD]
[TD]Turkey[/TD]
[TD]10.00[/TD]
[TD][/TD]
[TD][/TD]
[TD]Roasting[/TD]
[TD]3.00[/TD]
[TD]Back[/TD]
[TD]1.50[/TD]
[/TR]
[TR]
[TD]George[/TD]
[TD]456[/TD]
[TD][/TD]
[TD][/TD]
[TD]Leg[/TD]
[TD]4.00[/TD]
[TD][/TD]
[TD][/TD]
[TD]Gammon[/TD]
[TD]4.00[/TD]
[/TR]
[TR]
[TD]Arnold[/TD]
[TD]789[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Steak[/TD]
[TD]2.00[/TD]
[TD]Streaky[/TD]
[TD]1.00[/TD]
[/TR]
</tbody>[/TABLE]

What I want to do is get data from rows to generate an invoice listing only the data held in rows and ignoring all the empty cells. The results being passed to new sheet called invoice and listed as below, my original sheet has 54 columns and possibly up to 1000 rows so would want to go through list one row at a time and the print one invoice at a time.[TABLE="class: cms_table, width: 20"]
<tbody>[TR]
[TD]Name[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Fred[/TD]
[TD][/TD]
[TD]Turkey[/TD]
[TD]10.00[/TD]
[TD]@1.20[/TD]
[TD]12.00[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]Roasting[/TD]
[TD]3.00[/TD]
[TD]@4.50[/TD]
[TD]13.50[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]Back[/TD]
[TD]1.50[/TD]
[TD]@2.50[/TD]
[TD]3.70[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]Invoice[/TD]
[TD]Total[/TD]
[TD][/TD]
[TD]29.20[/TD]
[/TR]
</tbody>[/TABLE]

Thanks
 
Hi Mike thanks for your interest but I was trying to use a Macro because I want to run it from a Button on the main menu.
At the moment I am hoping to try to attach a copy of my file to show the data I want to extract plus how I would like to display the results but not having much success, but again thanks for your interest.

Regards
Brian
 
Upvote 0

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.

Forum statistics

Threads
1,224,825
Messages
6,181,190
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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