none
ActiveX update LinkFillRange VBA RRS feed

  • Question

  • I have asheetina workbookcontrollingan ActiveXComboBoxthat isfilledwitha defined area.If I changetherange,using VBAI needto reload thedatafrom the area.The method givenin the helpdoes not work formy use.

    worksheets("Sheet1").OLEObjects(1).Update


    VALL2

    Monday, December 10, 2012 10:08 AM

Answers

  • Like this one

    Private Sub ComboBox1_GotFocus()
    Dim List    As Worksheet
    Dim ostA    As Long
    
    Set List = ActiveSheet
    ostA = List.Range("A1").End(xlDown).Row 'from A1 to last
    Me.OLEObjects(1).ListFillRange = ActiveSheet.Name & "!A1:A" & ostA 'edit this for your range
    Set List = Nothing
    End Sub

    Add this code to sheet1 module !


    Oskar Shon, Office System MVP

    Press if Helpful; Answer when a problem solved

    • Marked as answer by VALL2 Monday, December 10, 2012 11:54 AM
    Monday, December 10, 2012 10:56 AM
    Answerer

All replies

  • Like this one

    Private Sub ComboBox1_GotFocus()
    Dim List    As Worksheet
    Dim ostA    As Long
    
    Set List = ActiveSheet
    ostA = List.Range("A1").End(xlDown).Row 'from A1 to last
    Me.OLEObjects(1).ListFillRange = ActiveSheet.Name & "!A1:A" & ostA 'edit this for your range
    Set List = Nothing
    End Sub

    Add this code to sheet1 module !


    Oskar Shon, Office System MVP

    Press if Helpful; Answer when a problem solved

    • Marked as answer by VALL2 Monday, December 10, 2012 11:54 AM
    Monday, December 10, 2012 10:56 AM
    Answerer
  • thanks, it runs.

    VALL2

    Monday, December 10, 2012 11:54 AM