Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
QB QB is offline
external usenet poster
 
Posts: 57
Default Refresh a Combobox

I have a cbo which is linked to a named ranged on another sheet.

Using code, the named range gets deleted and the recreated, but the cbo does
not update it list of items to reflect the new named range content. How can
I refresh its list?

QB
  #2   Report Post  
Posted to microsoft.public.excel.programming
QB QB is offline
external usenet poster
 
Posts: 57
Default Refresh a Combobox

If I close the workbook and reopen it, it refreshes the item list properly?!
So why doesn't it adjust when I redefine the named range using vba?

QB





"QB" wrote:

I have a cbo which is linked to a named ranged on another sheet.

Using code, the named range gets deleted and the recreated, but the cbo does
not update it list of items to reflect the new named range content. How can
I refresh its list?

QB

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 135
Default Refresh a Combobox

Hi,

And this :
'----------------------------
With Worksheets("Sheet1")
'Redefine your name
.Range("b1:b75").Name = "toto"
'You add this line
.OLEObjects("ComboBox1").ListFillRange = "toto"
End With
'----------------------------



"QB" a écrit dans le message de groupe de discussion :
...
I have a cbo which is linked to a named ranged on another sheet.

Using code, the named range gets deleted and the recreated, but the cbo does
not update it list of items to reflect the new named range content. How can
I refresh its list?

QB

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Refresh a Combobox

Use the gotfocus method to repopulate

Private Sub ComboBox1_GotFocus()
ComboBox1.ListFillRange = Application.Names("Stuff").RefersToRange.Address
End Sub
--
HTH...

Jim Thomlinson


"QB" wrote:

If I close the workbook and reopen it, it refreshes the item list properly?!
So why doesn't it adjust when I redefine the named range using vba?

QB





"QB" wrote:

I have a cbo which is linked to a named ranged on another sheet.

Using code, the named range gets deleted and the recreated, but the cbo does
not update it list of items to reflect the new named range content. How can
I refresh its list?

QB

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Refresh a Combobox

Are you using the combobox from the Forms commandbar or from the
Controls commandbar? Also, what exactly are you deleting? Are clearing
the values within the named Range (e.g.,
Range("TheList").ClearContents), or are you deleting the cells
referenced by the name (e.g., Range("TheList").Delete) or are you
deleting the name itself (e.g.,
ThisWorkbook.Names("TheList").Delete)???

Cordially,
Chip Pearson
Microsoft MVP 1998 - 2010
Pearson Software Consulting, LLC
www.cpearson.com
[email on web site]



On Wed, 20 Jan 2010 12:45:01 -0800, QB
wrote:

I have a cbo which is linked to a named ranged on another sheet.

Using code, the named range gets deleted and the recreated, but the cbo does
not update it list of items to reflect the new named range content. How can
I refresh its list?

QB

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
refresh combobox mEl Excel Programming 2 November 16th 08 01:09 PM
Timing of automatic query refresh and macro pivot table refresh dutty Excel Programming 2 December 1st 04 07:19 PM
auto refresh for combobox Paul Lautman Excel Programming 0 May 19th 04 04:37 PM
Refresh combobox after inserting new sheet Duke17 Excel Programming 11 April 27th 04 02:55 PM
Pivot Table REFRESH Flaw -- Saves Old Data in Selection Area AFTER REFRESH Ken Roberts Excel Programming 3 September 11th 03 06:02 AM


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