Extract a dynamic list from a range in Excel based on specific criteria

Raghav Chamadiya

New Member
Joined
May 31, 2020
Messages
13
Office Version
  1. 2016
Platform
  1. Windows
I want to extract serial numbers(Column A) from a range of data based on the value of column P (Release status). So, if the status is pending I want to add the serial number in my list.
In the end I want to show this dynamic list in a listbox in userform, where he will be able to further interact with it. Hence I want this done through VBA instead of formulae.
Thanks a lot
MrExcel1.png
 
Hi,

Through my search for a solution for my problem I found this post which is nearly the same as mine

I used your code with some changes as below, but I still have some changes that I didn't find a solution for
VBA Code:
Dim Rng As Range
Dim Ary As Variant
Set wse = Sheet10
      Set Rng = wse.Range("F:F")

   Ary = Evaluate("transpose(if(" & Rng.Offset(, -1).Address(, , , 1) & "=""Wheel Loader""," & Rng.Address(, , , 1) & ",false))")

   Me.txtModel.List = Filter(Ary, False, False)

I have a database sheet with a lot of equipment and their details (Serial #, Type, Model, Make....)
In one of my UserForms, there is one ComboBox "txtType" which is a list using unique types only
Once I choose a Type, I need all the Models for this Type to be in the second ComboBox "txtModel"
Your code works fine, just one problem that is showing some Models several times

The needed changes are:
  • Replace "Wheel Loader" with ComboBox "txtType"
  • txtModel.List (I need it to get the unique values only if it's possible, since I need all the Models for the chosen type in ComboBox (txtType))
  • Sort the list A to Z if possible also
Many thanks in advanced
 
Upvote 0

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Please start a new thread for the question. Thanks.
Also please update your account details to show which version of Excel you are using, as it affects which functions you can use.
 
Upvote 0
Please start a new thread for the question. Thanks.
Also please update your account details to show which version of Excel you are using, as it affects which functions you can use.
Thanks Fluff,
Actually I post a thread few days before but didn't get what I need
Here is the thread link if you may help me with
 
Upvote 0
In that case I would suggest you refresh your memory regarding the board rules. ;)
Especially Rule#12 about duplicate questions.
 
Upvote 0
In that case I would suggest you refresh your memory regarding the board rules. ;)
Especially Rule#12 about duplicate questions.
But I didn't find similar questions that day once I post mine, anyway it's posted and can't return it back, so do you have a solution for my problem please
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

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