Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default adding ComboBox programitacally

Hello,
I am struggling a little.
I see you can add a CheckBox by doing this:
With ActiveSheet.CheckBoxes.Add(Range(objRange.Address) .Left +
Range(objRange.Address).width / 2 - 6, _
Range(objRange.Address).Top + Range(objRange.Address).height / 2 -
10, 15, 25)

However I am trying to build a combobox.

I have been trying a bunch of things
such as:

Dim objSheet As Excel.Worksheet
Set objSheet = Excel.ActiveSheet
Dim objRange As Excel.Range
Set objRange = Range("$F$10")

objSheet.ComboBoxes.Add ....

etc....

can anyone help on creating a combo box.
in a specific range area?
thanks


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default adding ComboBox programitacally

I don't know about your calculations/measurements, but this will put in a
combobox (dropdown box) from the forms toolbar:

Sub aAA()
Set objRange = Range("J13")
With ActiveSheet.DropDowns.Add( _
Range(objRange.Address).Left + _
Range(objRange.Address).Width / 2 - 6, _
Range(objRange.Address).Top + _
Range(objRange.Address).Height / 2 - 10, 15, 25)
End With
End Sub

--
Regards,
Tom Ogilvy


"greg" wrote:

Hello,
I am struggling a little.
I see you can add a CheckBox by doing this:
With ActiveSheet.CheckBoxes.Add(Range(objRange.Address) .Left +
Range(objRange.Address).width / 2 - 6, _
Range(objRange.Address).Top + Range(objRange.Address).height / 2 -
10, 15, 25)

However I am trying to build a combobox.

I have been trying a bunch of things
such as:

Dim objSheet As Excel.Worksheet
Set objSheet = Excel.ActiveSheet
Dim objRange As Excel.Range
Set objRange = Range("$F$10")

objSheet.ComboBoxes.Add ....

etc....

can anyone help on creating a combo box.
in a specific range area?
thanks



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default adding ComboBox programitacally

thanks,
looks good


"Tom Ogilvy" wrote in message
...
I don't know about your calculations/measurements, but this will put in a
combobox (dropdown box) from the forms toolbar:

Sub aAA()
Set objRange = Range("J13")
With ActiveSheet.DropDowns.Add( _
Range(objRange.Address).Left + _
Range(objRange.Address).Width / 2 - 6, _
Range(objRange.Address).Top + _
Range(objRange.Address).Height / 2 - 10, 15, 25)
End With
End Sub

--
Regards,
Tom Ogilvy


"greg" wrote:

Hello,
I am struggling a little.
I see you can add a CheckBox by doing this:
With ActiveSheet.CheckBoxes.Add(Range(objRange.Address) .Left +
Range(objRange.Address).width / 2 - 6, _
Range(objRange.Address).Top + Range(objRange.Address).height /

2 -
10, 15, 25)

However I am trying to build a combobox.

I have been trying a bunch of things
such as:

Dim objSheet As Excel.Worksheet
Set objSheet = Excel.ActiveSheet
Dim objRange As Excel.Range
Set objRange = Range("$F$10")

objSheet.ComboBoxes.Add ....

etc....

can anyone help on creating a combo box.
in a specific range area?
thanks





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
Adding Combobox Values Corey Excel Programming 3 January 7th 07 05:34 PM
Creating/Adding Combobox WLMPilot Excel Programming 1 January 7th 07 03:21 PM
Dynamically adding data to a Combobox? samanathon Excel Programming 4 April 5th 04 11:26 AM
Having problems with adding input from combobox stevem[_5_] Excel Programming 1 April 2nd 04 03:44 AM
3 possible methods for adding value to a combobox Todd Huttenstine[_3_] Excel Programming 3 January 25th 04 01:16 AM


All times are GMT +1. The time now is 03:49 PM.

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

About Us

"It's about Microsoft Excel"