ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Unique values in combobox2 in excel VBA (https://www.excelbanter.com/excel-programming/450875-unique-values-combobox2-excel-vba.html)

[email protected]

Unique values in combobox2 in excel VBA
 
Hi all,

I want to add unique values in combobox2 once I select from combobox1.

Column A Column B
-------- --------
Girls Hair
Boys Hair
Veg Water
Non-Veg Water

Once I select Girls in combobox1 (retrieved from column 'A' in excel), it should show unique value of 'Hair' from column 'B' instead of twice in excel.

I want to add the unique values in combobox2 from column 'B' in excel where combobox1 text is equal to column 'A'.

GS[_6_]

Unique values in combobox2 in excel VBA
 
Hi all,

I want to add unique values in combobox2 once I select from
combobox1.

Column A Column B
-------- --------
Girls Hair
Boys Hair
Veg Water
Non-Veg Water

Once I select Girls in combobox1 (retrieved from column 'A' in
excel), it should show unique value of 'Hair' from column 'B' instead
of twice in excel.

I want to add the unique values in combobox2 from column 'B' in excel
where combobox1 text is equal to column 'A'.


Why are you using Combobox2? The purpose of a combobox is to provide a
list of items, not a unique value.

A formula will do what you want...

In B2:
=IF(OR(A2="Girls",A2="Boys"),"Hair","Water")

...and copy down!

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion




All times are GMT +1. The time now is 09:53 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com