Consulting

Results 1 to 6 of 6

Thread: Need Help Fixing VBA Code for Comboboxes

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Need Help Fixing VBA Code for Comboboxes

    How do I modify the following code to always reference ComboBox1 on slide 4 for the Set oShape?

    I currently have to click the combobox and then run the macro. However when I send to another user the VBA is not active anymore unless I rerun the macro. I would like it to become static and fixed - "Only refering to Combobox1"


    Sub AddItemsToIncidentListBox()
    Dim oShape As Shape
    Set oShape = ActiveWindow.Selection.ShapeRange(1)
    With oShape.OLEFormat.Object
        ' Add items to the list
        .AddItem ("Earthquake")
        .AddItem ("Fire")
        .AddItem ("Medical")
        .AddItem ("Workplace Violence")
        .AddItem ("Bomb Scare")
        .AddItem ("Traffic Issue")
        .AddItem ("Building Incident")
        .AddItem ("Campus Incident")
        ' You could work with other properties of the list or combo box here as well
    End With
    End Sub


    KREEPA
    Last edited by Aussiebear; 04-28-2023 at 08:30 PM. Reason: Added code tags

Posting Permissions

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