I need a formula or VBA to copy values to another sheet and omit blanks and zeros

belalb3

New Member
Joined
Jan 10, 2011
Messages
4
Hello,
I have a table with 900 maintenance parts. I select the items I want for example 20 items. then I need to go to another sheet and list the items I picked.

In the second sheet, I'm interested in getting the description, value, and quantity only. For now, I'm manually copying the description to the second sheet, and to get the value and quantity, I run a vlookup.

I was trying to find a formula to get the description insted of copying them one by one. I tried if function, but the issue is if-function is pulling the items with "0" in quantity.


I'm interested in getting the description for items that have a quantity greater than 0 and omit the rows with zero/blank quantity

below is an example of the table. Is there a way to do this with formula or VBA?

Product nameDescriptionValueQuantity
CarItem 1$ 1,000.00
2​
CarItem 2$ 500.00
2​
CarItem 3$ 250.00
0​
CarItem 4$ 100.00
Total$ 1,850.00
4​

I would appreciate if anyone could help me with this!
 

Some videos you may like

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying

JB2020

Board Regular
Joined
Jul 29, 2020
Messages
75
Office Version
  1. 365
  2. 2016
  3. 2010
Platform
  1. Windows

Watch MrExcel Video

Forum statistics

Threads
1,122,297
Messages
5,595,301
Members
413,985
Latest member
daniel1969

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
Top