LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Populate a Multicolumn ComboBox with filtered range

I have a worksheet with 40 columns.

This is part of the worksheet:

-- A
B C
D .... BA
1 ID
BussinessType Name
City 1
2 123451
1 John Lennon New Orleans
3 123452
2 Luigi Federline Ontario
4 123453
1 Arthur Diaz Los Angeles
5 123454
2 Jane Lisboa Portland

I want to populate a 4-column combobox (within these columns) with
rows where BussinessType is equal to 1.


This is my Code:

'----Start Code----

Sub Populate_Combobox()

Dim rnData As Range
Dim vaData As Variant
Dim i As Long

With Sheet1

Set rnData = .Range(.Range("B1"), .Range("B65536").End(xlUp))

rnData.AdvancedFilter Action:=xlFilterCopy,
CopyToRange:=Range("BA1"), Unique:=True

vaData = .Range(.Range("BA2"), .Range("BA65536").End(xlUp)).Value

.Range(.Range("BA1"), .Range("BA65536").End(xlUp)).ClearContents

End With

With ComboBox1
.Clear
.List = vaData
.ListIndex = -1
End With

End Sub

'----End Code----


But this only works in a single column combobox, and still gives me
all the records.

What is the problem?

Juan

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Multicolumn combobox Gromit Excel Programming 2 January 23rd 06 04:14 PM
MultiColumn ComboBox Paul Smith[_3_] Excel Programming 2 August 3rd 05 06:36 AM
Populate a Combobox from range. ex1302[_8_] Excel Programming 14 July 22nd 05 05:32 PM
MultiColumn ComboBox Value set/display Jim Zeeb[_2_] Excel Programming 5 June 13th 05 09:20 AM
populate multicolumn listbox? Alen32 Excel Programming 4 March 22nd 05 09:22 PM


All times are GMT +1. The time now is 12:02 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"