Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: VBA Excel need to add what column to look at to this macro  (Read 2391 times)

0 Members and 1 Guest are viewing this topic.

RedBorg

    Topic Starter


    Starter

    • Experience: Experienced
    • OS: Windows 8
    VBA Excel need to add what column to look at to this macro
    « on: March 20, 2016, 05:06:52 PM »
    Hi,
    I have a working macro that targets all of the ComboBoxes in my worksheet. I need it to only target whatever Column I choose. The Column will be the location of the comboBoxe's.  Here's what I have that works but does every comboBox on my sheet.
    Code: [Select]
        Sub AllocateLinkedCellsToComobBoxes()
            Dim cbo As OLEObject
            For Each cbo In ActiveSheet.OLEObjects
            If TypeOf cbo.Object Is ComboBox Then
                cbo.Select
                Selection.LinkedCell = Selection.TopLeftCell.Address
                cbo.LinkedCell = cbo.TopLeftCell.Address
            End If
          Next
        End Sub