• Hidden Combo

    Author
    Topic
    #465254

    Good morning

    I have a hidden combo that is populated as follows (by clicking Run in the VB editor) and used to work on about 9 different worksheets, I have added 2 items to the combo list and now it works in only one worksheet, ‘Directors’

    Code:
    Sub Populate_Combo()
    
    With ActiveSheet.MyCombo
    .ListFillRange = Worksheets("ComboFill") _
    .Range("A2:A23").Address(external:=True)
    End With
    
    End Sub

    If I now activate the hidden combo in say my worksheet called ‘Sales’ it shows but (a) stays visible and (b) does not populate the cell with the combo selection.

    Stepping through the code in the ‘Sales’ worksheet it halts as shown below

    Code:
    Private Sub Worksheet_BeforeDoubleClick _
    (ByVal Target As Range, Cancel As Boolean)
    
    If Not Intersect(Range("D6:AI147"), Target) Is Nothing Then
    
    End If
    
    Cancel = True
    
    
    [color color="#FFFF00"]ActiveSheet.MyCombo.Visible = True[/color]

    End Sub

    But ‘Sales’ is the active sheet?

    Any ideas please

    Viewing 2 reply threads
    Author
    Replies
    • #1194554

      Could you post a sample?
      There doesn’t appear to be any code there that would populate a cell anyway.

    • #1194720

      Hi Rory

      Sorry but I could not strip down a version enough to post and leave all of the funcionality going. I have ‘dibbled and dabbled’ and by running the sub when each of the worksheets have been open it seems to have done what I wanted it to do, one of those more luck than judgement moments.

      Thanks and Happy New Year to you and yours.

      Cheers

    • #1194721

      And to you too!

      Glad you got it working but, for the record, I would advise against using ActiveX controls (from the Control Toolbox) on worksheets if possible. They can be a little unstable and the Forms versions are generally preferable, IMO.

    Viewing 2 reply threads
    Reply To: Hidden Combo

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: