Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 220
Default How to Load Combo Box with Named Range

I have a named range "SNList" on worksheet "SN List". The named range
consists of two columns and 30 rows. I want to fill a combobox (named
"CMB_SN_List") using the contents of the named range. The combobox is set up
with two columns. The combobox is on worksheet "Weekly Data".

What is the proper syntax for that?

I have tried things like:

Worksheets("Weekly Data").OLEObjects("CMB_SN_List").ListFillRange =
Worksheets("SN List").Range("SNList")

but that generates an error. Do I have to use the .AddItem method since I
have more than one column?

Thanks,

Eric

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 220
Default How to Load Combo Box with Named Range

Never mind. It's as simple as

..ListFillRange = "SNList"


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default How to Load Combo Box with Named Range

You're using the ActiveX combobox, so its


Worksheets("SN List").CMB_SN_List.ListFillRange = "SNList"




"EricG" wrote in message
...
I have a named range "SNList" on worksheet "SN List". The named range
consists of two columns and 30 rows. I want to fill a combobox (named
"CMB_SN_List") using the contents of the named range. The combobox is set
up
with two columns. The combobox is on worksheet "Weekly Data".

What is the proper syntax for that?

I have tried things like:

Worksheets("Weekly Data").OLEObjects("CMB_SN_List").ListFillRange =
Worksheets("SN List").Range("SNList")

but that generates an error. Do I have to use the .AddItem method since I
have more than one column?

Thanks,

Eric

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 220
Default How to Load Combo Box with Named Range

Thanks for the reply, Patrick.

One more question - after the user selects whatever from the combbox, I am
using ".Visible = false" to hide it. However, its image stays on the screen.
If I scroll it out of sight and back in, it's gone, which tells me it is
invisible, so the remaining image must be a "ghost".

Is there a neat trick to force a screen redraw to get rid of this "ghost"
image of the combobox?

Thanks,

Eric

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default How to Load Combo Box with Named Range

interesting. maybe do the scroll in vba after setting the visible state?
perhaps turning off screen updating to avoid flicker


"EricG" wrote in message
...
Thanks for the reply, Patrick.

One more question - after the user selects whatever from the combbox, I am
using ".Visible = false" to hide it. However, its image stays on the
screen.
If I scroll it out of sight and back in, it's gone, which tells me it is
invisible, so the remaining image must be a "ghost".

Is there a neat trick to force a screen redraw to get rid of this "ghost"
image of the combobox?

Thanks,

Eric

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
ActiveX Combo Box ListFillRange = Worksheet Named Range Philip J Smith Excel Programming 1 June 22nd 07 02:45 PM
Combo Box Load Above Control? misseill Excel Programming 1 March 14th 06 11:46 PM
Delete from named range based on Combo Box selection shebert Excel Programming 4 August 8th 05 05:18 PM
combo box named range BB Excel Discussion (Misc queries) 2 June 21st 05 04:27 PM
Excel 97 VBA: Binding a combo to a named range David Excel Programming 5 October 22nd 03 07:13 PM


All times are GMT +1. The time now is 12:06 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"