+ Reply to Thread
Results 1 to 3 of 3

Combo Box Update

Hybrid View

  1. #1
    Registered User
    Join Date
    02-15-2009
    Location
    NJ
    MS-Off Ver
    Excel 2003
    Posts
    8

    Combo Box Update

    Hi,

    My combobox is set to update everyone time there is a change to the particular worksheet. Its contents are also clear in order to prevent the combo box from continuously adding the same values to the sheet. However, this combo box is also linked to cell C30. Is there a way to prevent the value of C30 from being cleared everytime there is a change to the worksheet?

    Thanks, code below.


    Private Sub Worksheet_Change(ByVal Target As Range)
      Dim i As Long
    Dim col As Long
        i = 3
        col = 2
    With ActiveSheet.OLEObjects("combobox1").Object
        .Clear
        Do Until Cells(i, col).Value = "Latest 12 Mos"
            .AddItem Cells(i, col).Value
            i = i + 1
        Loop
    End With
    End Sub

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,481

    re: Combo Box Update

    I guess you need to store the current value in a variable and then re-apply when the list update has completed.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561

    re: Combo Box Update

    Or break the link and apply the value to the cell on combobox_change?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1