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
0
Utf
1/20/2010 8:45:01 PM
excel.programming 6508 articles. 1 followers. Follow

4 Replies
4804 Views

Similar Articles

[PageSpeed] 17

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
-1
Utf
1/20/2010 9:19:01 PM
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" <QB@discussions.microsoft.com> a écrit dans le message de groupe de discussion : 
0FDE2633-6C4D-4DEB-8B71-EF91A3BCDED2@microsoft.com...
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 

0
michdenis
1/20/2010 9:30:25 PM
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
0
Utf
1/20/2010 9:33:01 PM
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 <QB@discussions.microsoft.com>
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
0
Chip
1/20/2010 10:33:57 PM
Reply:

Similar Artilces:

how do i refresh or sync all?
I am trying to force my mail to refresh, or to look for new mail much like Outlook Express does when you click on "Sync All". Maybe I shouldn't be concerned with this. Does Outlook deliver mail as soon as it is processed by the server or is it sent at preset intervals set by the administrator? Les perhaps you mean Send/Receive ? Still learning wrote: > I am trying to force my mail to refresh, or to look for new mail much like > Outlook Express does when you click on "Sync All". Maybe I shouldn't be > concerned with this. Does Outlook de...

Refresh some not Refresh All
Hello. I have a workbook with 10 sheets all of which have external data that needs to be refreshed periodically. Most of the time I only need to refresh 8 of the sheets. Is there a way to refresh just those 8 without having to refresh each one separately? Thanks in advance. You can use a macro to do it. It would go something like this... Sub RefreshSome() Dim wks As Worksheet Dim qt As QueryTable For Each wks In Worksheets Select Case wks.Name Case "Sheet1", "sheet2" Case Else For Each qt In wks.Que...

ComboBoxes and Formulas
How do I get a formula to recognize a selection from a Combo Box that I created from the Control Toolbox? For example, if the LinkedCell is A2 and the formula in B2 uses the chosen value in A2 as the reference for a VLOOKUP formula, what do I need to do to make the value in A2 recognizable to the formula in B2? Do I have to do anything in Properties, or enter something in the VBE? Thanks. EU You shouldn't need to do anything special. Are you saying the LinkedCell isn't linking properly? Try doing something simple like =A2 in some other cell, and see if it changes as you c...

Refresh 1 subform from another
I am trying to refresh a subform from another subform and I cannot seem to make it work. I have a button on subform 2 that needs to have subform1 refresh. I used Me.subform1.mainform.form.refresh and I get an error that says Method or Data Member not found. Anyone know what I did wrong? I am thinking I should use ! instead of . but I don't know what the difference is between them. Any help? -- Thanks As Always Rip Ripper wrote: >I am trying to refresh a subform from another subform and I cannot seem to >make it work. I have a button on subform 2 that needs to have su...

Refreshing
Hi !! I ve done a OCX to view certain type of images. The OCX has a dialog in it with buttons. This OCX has been loaded into a html page. When multiple OCX are being placed in the html page I find the images that are displayed flickers. I use invalidate to refresh but refreshing is very fast. What should I do now to make smooth refreshing. Thanx Sudharsan Double buffer the image. Create a memory bitmap, copy to it, the BitBlt to your OCX's HDC. This may increase CPU usage a little. "Sudharsan" <Sudharsan@discussions.microsoft.com> wrote in message news:A72BC9BB-...

VWD2008 will not refresh HTML file
I am trying to use the showmodaldialog function to display help files for my website. But when I make modifications to the HTML file, a previous version of that file is displayed from within the VWD environment, even if I just want to debug that file. I have restarted VWD, but the old version is still displayed. When I double-click that same file outside the VWD environment, the modified version is displayed, so I know the changes are being saved. I have searched the entire hard drive and there is no other file with the same name. ...

Cells WON'T stop refreshing automatically
I have a workbook with many worksheets and links that I need to publish externally with links locked so that users won't get the "The workbook you opened contains automatic links..." message. I have gone into <Tools> <Options> <Calculation>, unchecked the <Update Remote References> checkbox, and saved the workbook; however, each time I reopen the saved workbook, the <Update Remote References> checkbox has been rechecked by some mischevious gremlin, and I invariably get the "The workbook you opened contains automatic links..." mess...

Web Query Refresh problem
Hi I've set up a workbook that contains about 75 sheets. Each sheet contains a web query. I then have a summary sheet which summarises the actual part of information that I want from each web page. Everything works fine, most of the time. I've set up a little button to 'refresh all data'. However, sometimes the refresh doesnt seem to work on some of the sheets. It actually pulls data from a website which I've set up on a different sheet. If, however, you go to that individual sheet, and manually refresh that sheet, it pulls through the correct data from the web. Som...

Clipart Woe -- how to refresh location
How can I refresh the path to the clipart gallery for the clipart files? I have moved the clipart from a network location to the local harddrive and rebuild the artgal50.mmc file, but the gallery still looks to the network location?? Help is greatly appreciated, because searching the MS resources is drivining me nuts Nigel Nigel, they are coming to take you away, take you away. If you hear a knock on the front door, do not open it as it may be the fine gentlemen with a while jacket with straps on. Nigel, you are driving us nuts not telling us what version of Windows and Publisher you...

AJAX UpdatePanel does not refresh after calling Update()-Method
Hi, I'm new to AJAX and has a little Problem to get an UpdatePanel inside an CustomServerControl to work. My goal is to create an CustomServerControl with an (at designtime) unknown number of UpdatePanels, that can be updated seperatly. Since I'm stuck I create a litte more static testproject to analyse the problem but I ran out of ideas what I could been missing. I would be realy glad if someone can show me hwo to get the UpdatePanels working. I created an ServerControl-Project called ServerControlTest and an ASP WebApplication called AXAJTest The Default.asxp look...

ComboBox with 2 columns
In access a combo box can have two or more columns. Is this possible in Excel. If so how ? Stuart You'll want to use the Combo Box from the Control Toolbox. Then set the properties accordingly as you would have in access (columncount = 2, etc.). Stuart Grant wrote: > In access a combo box can have two or more columns. > Is this possible in Excel. If so how ? > Stuart Thanks for the clear answer. I'm using John Walkenbach's Enhanced Data form where he creates combo boxes through code. I'm not quite sure how to do that. His code says Set NewControl =CurrentF...

CWebBrowser2 and Refresh
Hi All, I am using CWebBrowser2 control to get values from a website then plot them on a chart. When I use Navigate2(..) I can handle the OnDocumentCompleteExplorer(..) message to parse the html file and update my chart. However, I don't always get an updated page, can someone give me an example of how to use Refresh2(..) to make sure I always get a non-cached page? Also, is there a message sent when Refresh() or Refresh2() has finished? Or maybe there's another way I can achieve what I want? Cheers, Rob ...

Chart source data invalidated when workbook refreshed
Hi all, We have a workbook with vba code which fetches data from the backend and displays it. Now i have a chart defined for some data in this workbook and then i refresh this workbook. The problem is the chart source data is invalidated for the new workbook data. Any solution for this ? Any help is highly appreciated :-) Louis - How does the macro refresh the data? Could you make use of a dynamic chart instead, for example, one that charts the last N points in the table? Here's some Dynamic Charting examples and links: http://www.geocities.com/jonpeltier/Excel/Charts/Dynamics...

Query Refresh-Enable Automatic Refresh Dialogue Box
I continually click the Enable Automatic Refresh button on the Query Refresh dialogue box so why does it continue to appear for the same worksheet? ...

Refresh Not Refreshing
DisplayRecord is used in a form to display detail information for a record. The Form_AfterUpdate code is used to refresh the records so that any updates are visible to the user. On my personal machine, the code works and the records are refreshed, however on my development machine at work, the code fails. I have confirmed that the global variable gCallingForm is being correctly updated and that the form is loaded. The .Refresh statement does not throw an error. Private Sub DisplayRecord() On Error GoTo Err_DisplayRecord gCallingForm = "frmTrailerInventoryMaintenan...

folder refresh
In XP sp3, when I delete files in any directory I have to click on F5 key to get new folder content otherwise I see all previous files. Suggestions ? Riccardo wrote: > In XP sp3, when I delete files in any directory I have to click on F5 > key to get new folder content otherwise I see all previous files. > Suggestions ? So press F5. Or just ignore the phantom files. -- dadiOH ____________________________ dadiOH's dandies v3.06... ....a help file of info about MP3s, recording from LP/cassette and tips & tricks on this and that. Get it at http://mysite.v...

Refresh an Excel link with button
In my tables I have a link to an Excel workbook. What VBA code can I put in the OnClick event of a button to automatically refresh that link? CurrentDb.Tabledefs("myexcelTable").refreshlink HtH Pieter <taxidermist@cableone.net> wrote in message news:1193841279.082792.319810@19g2000hsx.googlegroups.com... > In my tables I have a link to an Excel workbook. What VBA code can I > put in the OnClick event of a button to automatically refresh that > link? > ...

Need help refreshing a datagrid client side
Hi -- I'm very, very new to ASP.Net, and I've been trying for several days to figure out how to update a datagrid AND refresh it on the client side so that the page doesn't refresh. I've torn my code apart over and over each time I tried what I thought would be the code that would solve my problem. Maybe I'm going down the completely wrong path here. Essentially, here is an explanation of my ASP.NET webform application and what I want it to do: Employees add how much time they spend on a job, and then that information is added to a SQL database and displayed in a datagri...

refresh
i am trying to refresh a query every 10 min. using the .RefreshPeriod = 10 in the query loop doesn't redue all of the macro formatting that follows query so i was wondering if refresh could be used in a sub to run the main macro. something like this sub refresh() Application.Run "'TEST.XLS'!GetData" ..RefreshPeriod = 10 End Sub or how would i automate running the macro. this is the query loop in main macro Workbooks.Add With ActiveSheet.QueryTables.Add(Connection:=connectURL, Destination:=Range("A1")) .BackgroundQuery = True .TablesOn...

How do I refresh a pivot table
I have created a pivot table from a worksheet but haven't worked out how to refresh the pivot table to reflect the update in the worksheet. Any assistance! Fred - If the Pivot Table command bar is visible, click on the red exclamation point button (pick Toolbars from the View menu to make it visible). Or right click on the pivot table and select Refresh Data from the pop up menu. - Jon ------- Jon Peltier, Microsoft Excel MVP http://www.geocities.com/jonpeltier/Excel/index.html _______ Fred wrote: > I have created a pivot table from a worksheet but > haven't worked ...

Bound ComboBox and Default Values
I have a 2 column ComboBox bound to a row source and a control source. Is it possible for me to set a default value, one that isn't in the control/row source? The Default Value needs to be one of the choices in the list. What is it you are tryinig to do? Maybe we can help with some ideas. -- Dave Hargis, Microsoft Access MVP "Chris" wrote: > I have a 2 column ComboBox bound to a row source and a control > source. Is it possible for me to set a default value, one that isn't > in the control/row source? > > ...

Refresh Pivot Chart with Table?
I'm creating a large workbook with master data on one page and on all following pages Pivot Tables with associated Pivot Charts, one worksheet per state, 4 tables and charts per page. When I copy the Alabama formatted page to another worksheeet and change the Report Filter to Arkansas the table reflects the correct data, however the chart still shows Alabama data. Right-clicking on the chart and Select Data Source provides a greyed-out Chart Data Range. How do I fix this? Ideally I'd like to do this in as few steps as possible, but will change each chart individually if ...

refreshing random generated data
Version: 2008 Operating System: Mac OS X 10.5 (Leopard) Processor: Intel I've made a program to randomly generate a 3-variable selection from 3 separate unrelated columns of data, but the only way I can find to refresh the table and get a new set of random variables is to change something in the database. The easiest way I've found to do this is to simply click on the border between the row or column labels (which would resize the columns if I click/drag to the new width), and it works fairly well but my professor saw me using it, gave me props, and asked for a copy. I'd lik...

Carriage return character in combobox
Hello I'm using an Active-x combobox with about 8 selection possibilities. I need to make it in a thin column so I'm trying to use two lines when a selection is made. Unfortunately it's coming up with the carriage return character in the selection. I guess that's what it is a backwards P sort of thing. Looking through the properties for the control I didn't see any reference toward word wrap or multiline. In the text field of the properties it has little rectangle boxes that I can't delete. Any way to make this ugly backwards P go away and still make t...

Refreshing Form with Multiple Forms and Fields
I have a main screen form that allows entry to start from that location. It has four subforms and some other fields that are picked from other locations to filter the record. My challenge is it does not Refresh right away. I have tried putting Refresh and Repaint etc in the main form code but it still doesn't refresh. I put a Refresh button on it and that works but it's slow. Can anyone tell me what would be a more efficient method to get this screen to refresh right away. Thank you, ...