Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Fill Combo Box

Hello,

i have inserted a ComboBox called "ComboBox1" into an Excel Sheet. Now
I would like to fill this using vba.

unfortunately ComboBox1.additem "test" does not work. this only seems
to work when i insert a combobox into a user form.

how do i fill the combo box that is placed directly into the excel
sheet using vba?

thanks for your help
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Fill Combo Box

Hi,

If you want to fill single word, try this code

With Sheet1.ComboBox1
.Value = "Test"
End With

If you want to fill a range of list then try the following.

Dim n As Integer
n = Cells(Rows.Count, "A").End(xlUp).Row
With Sheet1.ComboBox1
.AutoSize = False
.AutoTab = False
.List = Worksheets("Sheet1").Range("A1:A" & n).Value 'Range of
List containing in the Column A:A
End With

Regards,
Kannan
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
Fill combo box from range Gary Keramidas Excel Programming 1 August 20th 07 06:50 AM
Conditional Combo Box Fill Steve Excel Programming 0 June 28th 07 05:40 AM
Combo Box fill Hal[_4_] Excel Programming 2 November 20th 05 06:43 PM
Fill two column combo box Steve Excel Programming 9 November 6th 05 11:41 PM
Combo Box Fill Range Tim Halligan Excel Programming 1 April 28th 04 07:29 PM


All times are GMT +1. The time now is 02:14 AM.

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

About Us

"It's about Microsoft Excel"