I created a `UserForm1` and inserted a `CheckBox1`.

Now, if the user checks the `CheckBox1` I want that the `public variable` called `CheckBox1_Value` gets asigned the value `1` to it.   
 If the `Checkbox1` is not checked the variable should get asigned the value `0` to it.

Afterwards I want to run a second `VBA` which inserts the value of this variable into `Sheet1.Range("A1")`.

---

I tried to do this with the following codes:

**1) UserForm1:**

```
Public CheckBox1_Value

Private Sub CheckBox1_Click()
If Filter_Data.CheckBox1.Value = True Then
    CheckBox1_Value = 1
    Else
    CheckBox1_Value = 0
    End If
End Sub

```

**2) Module**

```
Sub Value_of_variable ()
Sheet1.Range("A1").Value = CheckBox1_Value
End Sub

```

---

The codes above are running without any error message but the value of the `public variable` is not entered into `Sheet1.Range("A1")`. The cell remains emtpy so I assume somehow the value is not assigned/extracted correctly to/from the `variable`.

What do I need to change to make it work?