• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

VBA to named check boxes according to cell value

Ateeb Ali

Member
Dear Sir
I need help in vba code, currently I am using below;

Code:
Sub Buyers()

Dim i As Long, N As Long
Dim Text As String

    N = Range("Buyers").Rows.Count
    With ActiveSheet
        For i = 1 To N
            If Range("Buyers").Cells(i) = vbEmpty Then
                .Shapes(i).Visible = msoFalse
            Else
                Text = Range("Buyers").Cells(i).Value
                .Shapes(i).TextFrame.Characters.Text = Text
                .Shapes(i).Visible = msoTrue
            End If
        Next i
      
    End With
 

End Sub

Its not working, dont know what mistake, I am also mentioning below my purpose;
1. I have two name range, C69:C82 is named as "PSETUP" & "C89:C128" is named as "Buyer"
2. I want to assign check boxes names on these names "PSETUP" to checkboxes range; "A8:A16" & "Buyer" to checkboxes range "C8:F17"
3. If cell is empty then check box should be hidden.
4. "Check Box" Text size should be wrapped and fix in cell and all check boxes should be aligned.
5. When we select Travel, should show result in text in filed: A22 and should be separated with ", " like multiple selection. Please see example in file.
6. Same point 5 example for buyer. Example available in file.

Regards
 

Attachments

  • Chandoo.xlsb
    23.5 KB · Views: 1
Back
Top