ExcelLost88
New Member
- Joined
- Dec 11, 2013
- Messages
- 1
Hello all!
I am currently creating a spreadsheet (excel 2010) where I have 2 recorded macros that are assigned to 1 checkbox1 in M6. The checkbox when clicked moves C6:L6 from "Warehouse to Rig" tab to "Rig to Well" tab and deletes when unclicked. How can I create multiple check boxes like the one mentioned and that moves with the row? For example, the next checkbox in M7 will move information from C7:L7 to the other spreadsheet. I would potentially need over 500+ checkboxes.
Any help is appreciated!
Thank you.
Here is my recorded macros:
Sub IFNO()
'
' IFNO Macro
'
'
Sheets("Rig to Well").Select
Range("B6:L6").Select
Selection.ClearContents
Sheets("Warehouse to Rig").Select
Range("L6").Select
End Sub
Sub IFYES()
'
' IFYES Macro
'
'
Range("B6:L6").Select
Selection.Copy
Sheets("Rig to Well").Select
Range("B6").Select
ActiveSheet.Paste
End Sub
Here is how I am running them with the checkbox:
Private Sub CheckBox1_Click()
Static AlreadyClicked As Boolean
If Not AlreadyClicked Then
IFYES
AlreadyClicked = True
Else
IFNO
AlreadyClicked = False
End If
End Sub
I am currently creating a spreadsheet (excel 2010) where I have 2 recorded macros that are assigned to 1 checkbox1 in M6. The checkbox when clicked moves C6:L6 from "Warehouse to Rig" tab to "Rig to Well" tab and deletes when unclicked. How can I create multiple check boxes like the one mentioned and that moves with the row? For example, the next checkbox in M7 will move information from C7:L7 to the other spreadsheet. I would potentially need over 500+ checkboxes.
Any help is appreciated!
Thank you.
Here is my recorded macros:
Sub IFNO()
'
' IFNO Macro
'
'
Sheets("Rig to Well").Select
Range("B6:L6").Select
Selection.ClearContents
Sheets("Warehouse to Rig").Select
Range("L6").Select
End Sub
Sub IFYES()
'
' IFYES Macro
'
'
Range("B6:L6").Select
Selection.Copy
Sheets("Rig to Well").Select
Range("B6").Select
ActiveSheet.Paste
End Sub
Here is how I am running them with the checkbox:
Private Sub CheckBox1_Click()
Static AlreadyClicked As Boolean
If Not AlreadyClicked Then
IFYES
AlreadyClicked = True
Else
IFNO
AlreadyClicked = False
End If
End Sub