View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Brian Brian is offline
external usenet poster
 
Posts: 683
Default Linking Check Box in User Form to Workbook

That fixed it!!! It works great and is exactly what I wanted it to do.

Thanks for your help

It was the first set of code that did it. I change .range to .checkboxes


"Dave Peterson" wrote:

What goes wrong when you run this?

Do you really have a range (a cell) named "Check Box 01"?

If you have checkboxes from the Forms toolbar:

With Workbooks("Forms.xlsm").Sheets("Install Pack Con")
.checkboxes("check box 01").value _
= UserForm1("Office_Package_Preparations_101").Value
end with

If you have checkboxes from the Control toolbox toolbar, then I'd rename them to
remove the space characters:

With Workbooks("Forms.xlsm").Sheets("Install Pack Con")
.checkbox01.value = UserForm1("Office_Package_Preparations_101").Value
end with

Or without renaming the checkbox:

With Workbooks("Forms.xlsm").Sheets("Install Pack Con")
.OLEObjects("check box 01").Object.Value = Userform1("checkbox1").Value
End With

Brian wrote:

I have a user Form with several Check Boxes in it. I would like for the Check
Boxes in the User Form to Check or Uncheck boxes in a different Workbook
worksheet. I tried the following code, but for some reason it does not work.

Can anyone please help me?

Sub Update_Forms1()

With Workbooks("Forms.xlsm").Sheets("Install Pack Con")

.Range("Check Box 01").Value =
UserForm1("Office_Package_Preparations_101").Value
.Range("Check Box 02").Value =
UserForm1("Office_Package_Preparations_102").Value
.Range("Check Box 03").Value =
UserForm1("Office_Package_Preparations_103").Value
.Range("Check Box 04").Value =
UserForm1("Office_Package_Preparations_104").Value

End With
End Sub


--

Dave Peterson
.