Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
columns in refedit to a combobox
How can I populate a ComboBox with the columns of a range selected in a
RedEdit? Thanks in advance |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
columns in refedit to a combobox
with userform1
.combobox1.text = .refedit1.text end with lets say the string return is refeditrange = "sheet1!$A5:$B10" You can extract the columns using string references or cell references set cellrange = range(refeditrange) firstcol = cellrange.column lastcolumn = firstcol + cellrange.columns - 1 you can do the same using string manipulations Sub test() refeditrange = "sheet1!$A5:$B10" 'get everything after first $ Firstcol = Mid(refeditrange, _ InStr(refeditrange, "$") + 1) Lastcol = Firstcol 'check if column is one letter of two letters If IsNumeric(Mid(Firstcol, 2, 1)) Then 'Column is A - Z Firstcol = Left(Firstcol, 1) Else 'Column is AA - IV Firstcol = Left(Firstcol, 2) End If 'get characters after 2nd $ Lastcol = Mid(Lastcol, _ InStr(Lastcol, "$") + 1) If IsNumeric(Mid(Lastcol, 2, 1)) Then 'Column is A - Z Lastcol = Left(Lastcol, 1) Else 'Column is AA - IV Lastcol = Left(Lastcol, 2) End If End Sub "LuisE" wrote: How can I populate a ComboBox with the columns of a range selected in a RedEdit? Thanks in advance |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
columns Widths for ComboBox | Excel Discussion (Misc queries) | |||
combobox multiple columns | Excel Programming | |||
Userform RefEdit updating ComboBox values | Excel Programming | |||
To refedit, or not to refedit, that is the question. | Excel Programming | |||
combobox with columns | Excel Programming |