Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Range to combobox- forget the blanks?
I saw a post not long ago showing how to populate a combobox from vba, using
a range of cells but ignoring the blanks. Excellent just what i needed, However, i can't get mine working right, I get permission denied on my other userform which i use to call the next, using the userform.show at the end of my sub. This only happens when I add a loop on the other form Here's what I saw.. I wonder if somebody could explain the for each line. Or post another solution that may help me solve my problem TIA Chris Private Sub Userform_Initialize() Dim sh as Worksheet Dim cell as Range set sh = Worksheet("sheet1") for each cell in sh.range(sh.cells(2,5),sh.cells(rows.count,5).End( xlup)) if not isempty(cell) then combobox1.AddItem cell end if Next End sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to Delete blanks between a range and populate only the names inthe given range | Excel Discussion (Misc queries) | |||
Charts forget range or data; fixed by manual alteration then Undo | Charts and Charting in Excel | |||
copy range of cells with blanks then paste without blanks | Excel Worksheet Functions | |||
Show one range in a combobox and write the 2nd range! | Excel Programming | |||
ComboBox.Value To Range | Excel Programming |