ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Remove blank rows from combobox (https://www.excelbanter.com/excel-programming/302541-remove-blank-rows-combobox.html)

Steph[_3_]

Remove blank rows from combobox
 
Hi all. I have a userform with comboboxes in it. I populate the combobox
with the following code:

Sub Show_UserForm()
UserForm1.ComboBox1.List = Worksheets("Data Tables").Range("A4:A30").Value
UserForm1.ComboBox2.List = Worksheets("Data Tables").Range("B4:B30").Value
UserForm1.ComboBox3.List = Worksheets("Data Tables").Range("C4:C30").Value
UserForm1.ComboBox4.List = Worksheets("Data Tables").Range("D4:D30").Value
UserForm1.Show
End Sub

The range it is reading from is larger than the number of data entries. I
wanted to allow for the user to add an entry to the combobox pulldown
without having to manipulate code. Can I still allow for this, but at the
same time NOT show 20 blank rows in the combobox pulldown?? Thanks for your
help!




Steph[_3_]

Remove blank rows from combobox
 
Hi guys. Never mind.....I should have known this!!

UserForm1.ComboBox1.List = Worksheets("Data Tables").Range("A4:A" &
Range("A65536").End(xlUp).Row).Value

Thanks anyway!

"Steph" wrote in message
...
Hi all. I have a userform with comboboxes in it. I populate the combobox
with the following code:

Sub Show_UserForm()
UserForm1.ComboBox1.List = Worksheets("Data Tables").Range("A4:A30").Value
UserForm1.ComboBox2.List = Worksheets("Data Tables").Range("B4:B30").Value
UserForm1.ComboBox3.List = Worksheets("Data Tables").Range("C4:C30").Value
UserForm1.ComboBox4.List = Worksheets("Data Tables").Range("D4:D30").Value
UserForm1.Show
End Sub

The range it is reading from is larger than the number of data entries. I
wanted to allow for the user to add an entry to the combobox pulldown
without having to manipulate code. Can I still allow for this, but at the
same time NOT show 20 blank rows in the combobox pulldown?? Thanks for

your
help!







All times are GMT +1. The time now is 05:30 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com