Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Multi column combo box

Hello...
Two questions:
1. What is the best way to dynamically set the range of the column
(pVarRange).

2. The data source column on sheet5 has a lot of leading spaces. I
want to use that column as the bound column and pass that value to the
"FindString" procedure that searches all of the other worksheets. In
addition, I want to trim that same column and display that value in
the second column of the combo box for presentation purposes
"trim(pVarArray(i,1))". I've set the
ComboBox1 properties to include:
Bound Column = 1
Column Count = 2
Column Widths = 0pt;250pt

I'm struggling with filling the second column. I've tried a couple of
variations using the list property, but cannot get it to work. Any
suggestions?

TIA
Zachary

Sub LoadCombo()
Dim pVarRange As Range
Dim pVarArray As Variant

With Sheet1
'// Set the combox fill range to column A
Set pVarRange = Sheet5.Range("A8:A200")
pVarArray = pVarRange.Value
.ComboBox1.Clear
For i = LBound(pVarArray) To UBound(pVarArray)
If IsEmpty(pVarArray(i, 1)) = False Then
.ComboBox1.AddItem pVarArray(i, 1)
'Fill second column here
End If
Next
.ComboBox1.ListIndex = 0
End With
Sheet1.Select

End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Multi column combo box

Sub LoadCombo()
Dim pVarRange As Range
Dim pVarArray As Variant

With Sheet1
'// Set the combox fill range to column A
With Sheet5.
Set pVarRange = .Range(.Range("A8), _
.Cells(rows.count,1).End(xlup))
End With
pVarArray = pVarRange.Value
.ComboBox1.Clear
For i = LBound(pVarArray) To UBound(pVarArray)
If IsEmpty(pVarArray(i, 1)) = False Then
.ComboBox1.AddItem pVarArray(i, 1)
.ComboBox1.List(Combobox.Listcount-1,1) = "abcd"
'Fill second column here
End If
Next
.ComboBox1.ListIndex = 0
End With
Sheet1.Select

End Sub

--
Regards,
Tom Ogilvy


Zachary Bass wrote in message
om...
Hello...
Two questions:
1. What is the best way to dynamically set the range of the column
(pVarRange).

2. The data source column on sheet5 has a lot of leading spaces. I
want to use that column as the bound column and pass that value to the
"FindString" procedure that searches all of the other worksheets. In
addition, I want to trim that same column and display that value in
the second column of the combo box for presentation purposes
"trim(pVarArray(i,1))". I've set the
ComboBox1 properties to include:
Bound Column = 1
Column Count = 2
Column Widths = 0pt;250pt

I'm struggling with filling the second column. I've tried a couple of
variations using the list property, but cannot get it to work. Any
suggestions?

TIA
Zachary

Sub LoadCombo()
Dim pVarRange As Range
Dim pVarArray As Variant

With Sheet1
'// Set the combox fill range to column A
Set pVarRange = Sheet5.Range("A8:A200")
pVarArray = pVarRange.Value
.ComboBox1.Clear
For i = LBound(pVarArray) To UBound(pVarArray)
If IsEmpty(pVarArray(i, 1)) = False Then
.ComboBox1.AddItem pVarArray(i, 1)
'Fill second column here
End If
Next
.ComboBox1.ListIndex = 0
End With
Sheet1.Select

End Sub



Reply
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
How to find a value with multi-column, multi-record list Dallasm Excel Worksheet Functions 1 May 30th 10 05:40 PM
Multi column lookup Cain Excel Discussion (Misc queries) 0 April 17th 08 10:01 AM
match in multi-column and multi-row array sloth Excel Discussion (Misc queries) 14 September 1st 06 10:33 PM
Multi Column Sum and conditions kalim Excel Worksheet Functions 1 May 23rd 06 03:06 PM
Extract values from a multi-select multi-column list-box Peter[_20_] Excel Programming 5 September 28th 03 04:04 PM


All times are GMT +1. The time now is 06:25 PM.

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

About Us

"It's about Microsoft Excel"