Consolidating a list into a Condensed version

maverick93

New Member
Joined
Jan 7, 2010
Messages
21
Column A5:A32 is a list of product, In a second column N5:N32 is where a quantity may be entered for the corresponding products in column A. Typically only 4 but a max of 9 of the cells in N5:N32 may have quantities in them the rest will be blank. What I would like to do is create a condensed list of only the products that have quantities in place that list in AE21:AE32 and the coresponding quantities in AF21:AF32.

I would like to do this using a ActiveX CommandButton if possible but if it needs to be done as a function then I can make that work.

Thanks for the help
 

Some videos you may like

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.

DanteAmor

Well-known Member
Joined
Dec 3, 2018
Messages
12,594
Office Version
  1. 2007
Platform
  1. Windows
I would like to do this using a ActiveX CommandButton

Try this
VBA Code:
Private Sub CommandButton1_Click()
  Dim a As Variant, c As Range, i As Long
  
  ReDim a(1 To 32, 1 To 2)
  For Each c In Range("N5:N32")
    If c.Value <> "" Then
      i = i + 1
      a(i, 1) = Range("A" & c.Row)
      a(i, 2) = c
    End If
  Next
  Range("AE5").Resize(UBound(a), 2).Value = a
End Sub
 

DanteAmor

Well-known Member
Joined
Dec 3, 2018
Messages
12,594
Office Version
  1. 2007
Platform
  1. Windows
I'm glad to help you. Thanks for the feedback.
 

Watch MrExcel Video

Forum statistics

Threads
1,123,535
Messages
5,602,217
Members
414,513
Latest member
junbuggle

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