VBA create table from existing table selecting rows based on values

NiccoExcel

New Member
Joined
Oct 30, 2015
Messages
6
I need to create a new table in excel on the existing sheet "ScratchPad" by pulling rows from the existing table named "ChemItems" but I only want to pull the rows if a value is populated in the column "Sale Price". Here is an example of the ChemItems table:

[TABLE="width: 500"]
<tbody>[TR]
[TD]Item[/TD]
[TD]Name[/TD]
[TD]Sale Price[/TD]
[/TR]
[TR]
[TD]00821463[/TD]
[TD]Super Rave[/TD]
[TD]$10.00[/TD]
[/TR]
[TR]
[TD]00812028[/TD]
[TD]Pink Suds[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]00824031[/TD]
[TD]Supersan[/TD]
[TD]$150.00[/TD]
[/TR]
[TR]
[TD]00132486[/TD]
[TD]PF-2[/TD]
[TD]$50.00[/TD]
[/TR]
</tbody>[/TABLE]

There are other existing columns on the table, but as far as I know they are irrelevant to the program I want to create. If I were to run the program successfully it would result in a new table on the sheet "ScratchPad" that would look like this:

[TABLE="width: 500"]
<tbody>[TR]
[TD]Item[/TD]
[TD]Name[/TD]
[TD]Sale Price[/TD]
[/TR]
[TR]
[TD]00821463[/TD]
[TD]Super Rave[/TD]
[TD]$10.00[/TD]
[/TR]
[TR]
[TD]00824031[/TD]
[TD]Supersan[/TD]
[TD]$150.00[/TD]
[/TR]
[TR]
[TD]00132486[/TD]
[TD]PF-2[/TD]
[TD]$50.00[/TD]
[/TR]
</tbody>[/TABLE]

Note that the "Pink Suds" item was removed because there was no value in the sale price.

I think I need to create a FOR NEXT program but I am not really sure where to begin. Please Help! :)
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop

Forum statistics

Threads
1,223,228
Messages
6,170,876
Members
452,363
Latest member
merico17

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