Consulting

Results 1 to 2 of 2

Thread: Solved: Simple question for CheckBox in sheet

  1. #1

    Solved: Simple question for CheckBox in sheet

    Hi All,

    I have the 1 CheckBox and Name is called "Main" in sheet1 of "A" workbook. In B workbook, I would like to get the status of the "Main" status whether is true. Then, i write the code here
    [vba]Sub Macro1()
    If Workbooks("A.xls").Sheets(1).Main.Value = True Then
    MsgBox "Main is True"
    End If
    End Sub[/vba]

    However, i get the error.

    Thanks,
    Ann

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    [vba]

    Sub Macro1()
    If Workbooks("A.xls").Sheets(1).CheckBoxes("Main").Value = 1 Then

    MsgBox "Main is True"
    End If
    End Sub
    [/vba]
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

Posting Permissions

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