(Enlarge)
|
- In the Visual Basic window, you'll see some code already setup.
- "Worksheet_BeforeDoubleClick" is responsible for activating Marlett checkboxes in C and D columns from row 2 to row 9:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
'Integrate checkbox functionality into C and D columns
If Not Intersect(Target, Range("C2:C9")) Is Nothing Then
Cancel = True
Target.Font.Name = "Marlett"
If Target = vbNullString Then
Target = "a"
Else
Target = vbNullString
End If
End If
If Not Intersect(Target, Range("D2:D9")) Is Nothing Then
Cancel = True
Target.Font.Name = "Marlett"
If Target = vbNullString Then
Target = "a"
Else
Target = vbNullString
End If
End If
End Sub
- "ApplyAutoFilters()" is responsible for copying rows from one sheet to other sheets based on criteria of (1) rows that are checked, (2) rows that are not checked:
Sub ApplyAutoFilters()
' Copy row data to sheet 2 which have 'in computer' checked
With Sheet1
.Range("A1:D9").AutoFilter Field:=4, Criteria1:="<>"
.Range("A1:D9").CurrentRegion.Copy Destination:=Sheet2.Range("A1").End(xlUp)
.Range("A1:D9").AutoFilter
End With
' Copy row data to sheet 3 which do not have 'in computer' checked
With Sheet1
.Range("A1:D9").AutoFilter Field:=4, Criteria1:=""
.Range("A1:D9").CurrentRegion.Copy Destination:=Sheet3.Range("A1").End(xlUp)
.Range("A1:D9").AutoFilter
End With
End Sub
- How do you get the visual basic code to run? There a "play" button at the top of the window as shown that, once it is clicked on, will execute the functions you've defined.
|