Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
MultiColumn ComboBox Display
Greetings,
I have a UserForm ComboBox with a RowSource of 27 rows and 20 columns. How can I get only the values in the 4th column to be displayed in the drop down window? Is this possible? Anyone have any ideas, thoughts or links related to this question? Any help will be appreciated. -Minitman |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
MultiColumn ComboBox Display
One way is to set the ColumnCount to 4 and the ColumnWidths to 0;0;0
-- Tim Zych www.higherdata.com Compare data in workbooks and find differences with Workbook Compare A free, powerful, flexible Excel utility "Minitman" wrote in message ... Greetings, I have a UserForm ComboBox with a RowSource of 27 rows and 20 columns. How can I get only the values in the 4th column to be displayed in the drop down window? Is this possible? Anyone have any ideas, thoughts or links related to this question? Any help will be appreciated. -Minitman |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
MultiColumn ComboBox Display
Hey Tim,
Thanks for the reply. Question: By changing the column count, won't that be limiting the number of columns in the row source? I can see the column width should effectively hide the first three columns, that is a real help!!! I was wondering, if I made the 4th column as wide as the ComboBox without limiting the number of columns, wouldn't that, in effect, give me the appearance of only the 4th column appearing in the ComboBox? Again, thanks for the pointer on the column widths. -Minitman On Fri, 30 May 2008 17:02:16 -0700, "Tim Zych" <tzych@NOSp@mE@RTHLINKDOTNET wrote: One way is to set the ColumnCount to 4 and the ColumnWidths to 0;0;0 -- Tim Zych www.higherdata.com Compare data in workbooks and find differences with Workbook Compare A free, powerful, flexible Excel utility "Minitman" wrote in message .. . Greetings, I have a UserForm ComboBox with a RowSource of 27 rows and 20 columns. How can I get only the values in the 4th column to be displayed in the drop down window? Is this possible? Anyone have any ideas, thoughts or links related to this question? Any help will be appreciated. -Minitman |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
MultiColumn ComboBox Display
ColumnCount limits only the display and you still have access to the hidden
columns. You can see by selecting a value in the combo, then running: MsgBox Me.ComboBox1.List(Me.ComboBox1.ListIndex, 15) which will display the 16th column of the selected row. Does not matter that ColumnCount = 4. I was wondering, if I made the 4th column as wide as the ComboBox without limiting the number of columns, wouldn't that, in effect, give me the appearance of only the 4th column appearing in the ComboBox? I don't think so. To achieve that effect, you might need to resort to something like: Private Sub UserForm_Initialize() Dim i As Integer, ColWidth As String For i = 1 To Range(Me.ComboBox1.RowSource).Columns.Count If i = 4 Then ColWidth = ColWidth & Me.ComboBox1.Width & ";" Else ColWidth = ColWidth & 0 & ";" End If Next ColWidth = Left(ColWidth, Len(ColWidth) - 1) Me.ComboBox1.ColumnWidths = ColWidth End Sub IMO easier to do it the other way. -- Tim Zych www.higherdata.com Compare data in workbooks and find differences with Workbook Compare A free, powerful, flexible Excel utility "Minitman" wrote in message ... Hey Tim, Thanks for the reply. Question: By changing the column count, won't that be limiting the number of columns in the row source? I can see the column width should effectively hide the first three columns, that is a real help!!! I was wondering, if I made the 4th column as wide as the ComboBox without limiting the number of columns, wouldn't that, in effect, give me the appearance of only the 4th column appearing in the ComboBox? Again, thanks for the pointer on the column widths. -Minitman On Fri, 30 May 2008 17:02:16 -0700, "Tim Zych" <tzych@NOSp@mE@RTHLINKDOTNET wrote: One way is to set the ColumnCount to 4 and the ColumnWidths to 0;0;0 -- Tim Zych www.higherdata.com Compare data in workbooks and find differences with Workbook Compare A free, powerful, flexible Excel utility "Minitman" wrote in message . .. Greetings, I have a UserForm ComboBox with a RowSource of 27 rows and 20 columns. How can I get only the values in the 4th column to be displayed in the drop down window? Is this possible? Anyone have any ideas, thoughts or links related to this question? Any help will be appreciated. -Minitman |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
MultiColumn ComboBox Display
Cool!!!
That was one of the gaps in my knowledge of vba. With this I can load my TextBoxes from the ComboBox list & display only the column I need in the ComboBox. Thank you, that helps a lot. -Minitman On Fri, 30 May 2008 18:52:08 -0700, "Tim Zych" <tzych@NOSp@mE@RTHLINKDOTNET wrote: ColumnCount limits only the display and you still have access to the hidden columns. You can see by selecting a value in the combo, then running: MsgBox Me.ComboBox1.List(Me.ComboBox1.ListIndex, 15) which will display the 16th column of the selected row. Does not matter that ColumnCount = 4. I was wondering, if I made the 4th column as wide as the ComboBox without limiting the number of columns, wouldn't that, in effect, give me the appearance of only the 4th column appearing in the ComboBox? I don't think so. To achieve that effect, you might need to resort to something like: Private Sub UserForm_Initialize() Dim i As Integer, ColWidth As String For i = 1 To Range(Me.ComboBox1.RowSource).Columns.Count If i = 4 Then ColWidth = ColWidth & Me.ComboBox1.Width & ";" Else ColWidth = ColWidth & 0 & ";" End If Next ColWidth = Left(ColWidth, Len(ColWidth) - 1) Me.ComboBox1.ColumnWidths = ColWidth End Sub IMO easier to do it the other way. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Populate a Multicolumn ComboBox with filtered range | Excel Programming | |||
Multicolumn combobox | Excel Programming | |||
MultiColumn ComboBox | Excel Programming | |||
MultiColumn ComboBox Value set/display | Excel Programming | |||
Hiding a column in a multicolumn combobox | Excel Programming |