SpeedyFingers
New Member
- Joined
- Mar 26, 2012
- Messages
- 38
Hello! I'm trying to figure out how to reset the data back to what it was if the checkbox has been checked then unchecked. My spreadsheet is basically inserting certian options if that checkbox is checked. For Example...
() Benefit Income
() Award Letter
() Proof of Receipt
If Benefit Income (Main Category ) is checked, the Award Letter and Proof of Receipt will populate. If Benefit Income is then unchecked the Award Letter and Proof of Receipt disappear.
There are other main categories that will be below and/or on top of this one so it needs to be able to move back to the place it was before the box was checked.
I have tried several things but haven't gotten anywhere. Please help!
() Benefit Income
() Award Letter
() Proof of Receipt
If Benefit Income (Main Category ) is checked, the Award Letter and Proof of Receipt will populate. If Benefit Income is then unchecked the Award Letter and Proof of Receipt disappear.
There are other main categories that will be below and/or on top of this one so it needs to be able to move back to the place it was before the box was checked.
I have tried several things but haven't gotten anywhere. Please help!

Code:
Sub Docs1()
'
' Docs1 Macro
'
Dim myBox As CheckBox
Dim myCell As Range
Dim cellRange As String
Dim cboxLabel As String
Dim linkedColumn As String
Static AlreadyClicked As Boolean
If Not AlreadyClicked Then
AlreadyClicked = True
Else
AlreadyClicked = False
End If
'
If ActiveSheet.CheckBoxes(Application.Caller).Value = 1 Then
MsgBox Application.Caller & " is checked"
End If
Range("A9:B18").Select
Selection.Cut
Range("A13").Select
ActiveSheet.Paste
With ActiveSheet
For Each myCell In .Range("B9:B12").Cells
With myCell
Set myBox = .Parent.CheckBoxes.Add(Top:=.Top, Width:=.Width, Left:=.Left, Height:=.Height)
With myBox
.LinkedCell = linkedColumn & myCell.Row
.Caption = cboxLabel
.Name = "checkbox_" & myCell.Address(0, 0)
End With
.NumberFormat = ";;;"
End With
Next myCell
End With
Sheets("Sheet2").Select
Range("B1:B4").Select
Selection.Copy
Sheets("Sheet1").Select
Range("C9").Select
ActiveSheet.Paste
End Sub