Sub Addcheckboxes()
Dim cell, LRow As Single
Dim chkbx As DropDown
Dim MyLeft, MyTop, MyHeight, MyWidth As Double
Application.ScreenUpdating = False
LRow = ActiveSheet.Range("A" & Rows.Count).End(xlUp).Row
For cell = 2 To LRow
If Cells(cell, "A").Value <> "" Then
MyLeft = Cells(cell, "E").Left
MyTop = Cells(cell, "E").Top
MyHeight = Cells(cell, "E").Height
MyWidth = Cells(cell, "E").Width
ActiveSheet.DropDowns.Add(MyLeft, MyTop, MyWidth, MyHeight).Select
End If
Next cell
Application.ScreenUpdating = True
End Sub
Sub RemoveCheckboxes()
'Dim chkbx As dropdowns
ActiveSheet.DropDowns.Delete
'For Each chkbx In ActiveSheet.CheckBoxes
' chkbx.Delete
'Next
End Sub
Sub CopyRows()
For Each chkbx In ActiveSheet.DropDowns
If chkbx.Value = 1 Then
For r = 1 To Rows.Count
If Cells(r, 1).Top = chkbx.Top Then
With Worksheets("STSabado")
LRow = .Range("A" & Rows.Count).End(xlUp).Row + 1
.Range("A" & LRow & ":D" & LRow) = _
Worksheets("Seleccion").Range("A" & r & ":D" & r).Value
End With
Exit For
End If
Next r
End If
Next
End Sub
Sub AddcheckboxesD()
Dim cell, LRow As Single
Dim chkbx As DropDown
Dim MyLeft, MyTop, MyHeight, MyWidth As Double
Application.ScreenUpdating = False
LRow = ActiveSheet.Range("A" & Rows.Count).End(xlUp).Row
For cell = 2 To LRow
If Cells(cell, "A").Value <> "" Then
MyLeft = Cells(cell, "E").Left
MyTop = Cells(cell, "E").Top
MyHeight = Cells(cell, "E").Height
MyWidth = Cells(cell, "E").Width
ActiveSheet.DropDowns.Add(MyLeft, MyTop, MyWidth, MyHeight).Select
With Selection
.Caption = ""
Worksheets("Hoja1").Range("A1").Value = 500
.Display3DShading = False
End With
End If
Next cell
Application.ScreenUpdating = True
End Sub
Sub RemoveCheckboxesD()
'Dim chkbx As dropdown
ActiveSheet.DropDowns.Delete
'For Each chkbx In ActiveSheet.dropdowns
' chkbx.Delete
'Next
End Sub
Sub CopyRowsD()
For Each chkbx In ActiveSheet.DropDowns
If chkbx.Value = 1 Then
For r = 1 To Rows.Count
If Cells(r, 4).Top = chkbx.Top Then
With Worksheets("STDomingo")
LRow = .Range("A" & Rows.Count).End(xlUp).Row + 1
.Range("A" & LRow & ":F") = _
Worksheets("Seleccion").Range("A" & r & ":D" & r).Value
End With
Exit For
End If
Next r
End If
Next
End Sub