Can anyone tell me if the below code is able to be run with ActiveX checkboxes? Any help is greatly appreciated!!!
Sub CopyRowsPipefitters()
Dim LRow As Long, ChkBx As CheckBox, WS2 As Worksheet
Set WS2 = Worksheets("Dispatch")
Set WS4 = Worksheets("Pipefitters")
ThisWorkbook.Unprotect Password:="a"
WS2.Unprotect Password:="a"
WS2.Visible = True
Range("A9:R300").ClearContents
Range("B2").Select
LRow = WS2.Range("A" & Rows.Count).End(xlUp).Row
WS4.Select
For Each ChkBx In ActiveSheet.CheckBoxes
If ChkBx.Value = 1 Then
LRow = LRow + 1
WS2.Cells(LRow, "A").Resize(, 9) = Range("F" & ChkBx.TopLeftCell.Row).Resize(, 9).Value
End If
Next
WS4.Visible = False
WS2.Protect Password:="a"
ThisWorkbook.Protect Password:="a"
Call WS2.Activate
End Sub
Sub CopyRowsPipefitters()
Dim LRow As Long, ChkBx As CheckBox, WS2 As Worksheet
Set WS2 = Worksheets("Dispatch")
Set WS4 = Worksheets("Pipefitters")
ThisWorkbook.Unprotect Password:="a"
WS2.Unprotect Password:="a"
WS2.Visible = True
Range("A9:R300").ClearContents
Range("B2").Select
LRow = WS2.Range("A" & Rows.Count).End(xlUp).Row
WS4.Select
For Each ChkBx In ActiveSheet.CheckBoxes
If ChkBx.Value = 1 Then
LRow = LRow + 1
WS2.Cells(LRow, "A").Resize(, 9) = Range("F" & ChkBx.TopLeftCell.Row).Resize(, 9).Value
End If
Next
WS4.Visible = False
WS2.Protect Password:="a"
ThisWorkbook.Protect Password:="a"
Call WS2.Activate
End Sub