OssieMac,
Would it be possible to provide a file of the code you posted here?
I'm using Excel 2003, and even though I'm copying and psating the code, the Combo Boxes end up being empty when I run/submit the form with the 3 Combo Boxes.
Thank you, OssieMac.
OssieMac wrote:
Hi again Brian,I see you have posted for more help no doubt due to me being
18-Feb-10
Hi again Brian
I see you have posted for more help no doubt due to me being slow to ge
back to you but as I have written this code I thought I might as well pos
it. If you get a better answer from someone else then go for it
For the following code you need 2 additional worksheets in your workbook
One called Raw Data and the other called Combo Data
In the Raw Data sheet you need your list of data in the first 3 columns
(That could be changed but better to keep it simple if it just means copyin
the 3 columns.
The first column will contain the data for the first combo bo
The second column has data for the 2nd combo bo
Third column has data for the third combo box
Now this data requires every row in each column to have data. Therefore th
data should look something like the following.(I am not sure which one is th
customer and which one is the office in you sample data so I have assumed th
first is customer and last is office but I am sure you can sort that out.
It does not matter if the customer is repeated and appears in multipl
states and/or multiple offices just so long as every cell in each colum
contains data like the following. (Some of the states I have used ar
ficticious because I am not from Nth America and i do not know the states o
abbreviations for them)
Customer State Offic
ACWOGAMA GA F534
AGSTGAAU GA R354
AGSTGABM GA R634
ACWOGAMA NJ A234
AGSTGAAU SF B12
AGSTGABM AL C678
Basically the system copies a unique sorted list of the data in column 1 o
Raw Data and places it in Column 1 of Combo Data when the form is loaded an
this becomes the Rowsource for Combo1
When a selection is made in Combo1 then AutoFilter is applied to the firs
column in Raw Data based on the value in Combo1. A unique sorted list of th
visible cells in column 2 is then copied to Column 2 of Combo Data and i
becomes the Rowsource for Combo2
When a selection is made in Combo2 then AutoFilter is applied to the 2n
column in Raw Data based on the value in Combo2. A unique sorted list of th
visible cells in column 3 is then copied to Column 3 of Combo Data and i
becomes the Rowsource for Combo3
'*******************************
'This sub between the asteeisk line
'in module that Shows userfor
'Last command is Userform1.Sho
Sub ShowTheUserform(
Dim rngFilter As Rang
'Next line is optiona
Application.ScreenUpdating = Fals
With Sheets("Combo Data"
'Clear existing dat
..Columns("A:C").ClearContent
'Name start cells for each ComboBox RowSourc
..Range("A1").Name = "Cbo1List
..Range("B1").Name = "Cbo2List
..Range("C1").Name = "Cbo3List
End Wit
'Create unique list of first colum
'of data for 1st ComboBox RowSourc
With Sheets("Raw Data"
'Turn off AutoFilte
..AutoFilterMode = Fals
'Set rng variable to all data in column
Set rngFilter = .Range(.Cells(1, "A"),
..Cells(.Rows.Count, "A").End(xlUp)
End Wit
'Copies unique data to Sheets("Combo Data"
rngFilter.AdvancedFilter
Action:=xlFilterCopy,
CopyToRange:=Range("Cbo1List"),
Unique:=Tru
'Name the column of data for 1st ComboBo
'Starts row 2; excludes column heade
With Sheets("Combo Data"
..Range(.Cells(2, "A"),
..Cells(.Rows.Count, "A")
..End(xlUp)).Name = "Cbo1Source
'Clear any existing Sort Parameter
..Sort.SortFields.Clea
'Set the Sort Parameter
..Sort.SortFields.Add
Key:=Range("Cbo1Source"), _
Previous Posts In This Thread:
Submitted via EggHeadCafe - Software Developer Portal of Choice
Putting Twitter Realtime Search to Work
http://www.eggheadcafe.com/tutorial...24-c9960b55b669/putting-twitter-realtime.aspx