Consolidating a list into a Condensed version

maverick93

New Member
Joined
Jan 7, 2010
Messages
23
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
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
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
 
Upvote 0
I'm glad to help you. Thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,788
Messages
6,121,588
Members
449,039
Latest member
Arbind kumar

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