麻烦哪位大神帮我注释一下这段代码的意思。
PrivateSubCommandButton1_Click()Application.ScreenUpdating=Falsey=Range("b65536").End...
Private Sub CommandButton1_Click()
Application.ScreenUpdating = False
y = Range("b65536").End(xlUp).Row
Range("c3:c" & y).ClearContents
Z = Sheets("考勤表").Range("b65536").End(xlUp).Row
For x = 3 To y
k = 0
For j = 6 To 35
For i = 4 To Z Step 2
If Cells(x, "b") = Sheets("考勤表").Cells(i, "b") And _
Application.WorksheetFunction.CountIf(Sheets("考勤表").Cells(i, j).Resize(2, 1), "R") > 0 Then
k = k + 1
If k = 1 Then
Cells(x, "c") = Sheets("考勤表").Cells(2, j) & "号"
Else
Cells(x, "c") = Cells(x, "c") & "," & Sheets("考勤表").Cells(2, j) & "号"
End If
End If
Next
Next
Next
Application.ScreenUpdating = True
End Sub 展开
Application.ScreenUpdating = False
y = Range("b65536").End(xlUp).Row
Range("c3:c" & y).ClearContents
Z = Sheets("考勤表").Range("b65536").End(xlUp).Row
For x = 3 To y
k = 0
For j = 6 To 35
For i = 4 To Z Step 2
If Cells(x, "b") = Sheets("考勤表").Cells(i, "b") And _
Application.WorksheetFunction.CountIf(Sheets("考勤表").Cells(i, j).Resize(2, 1), "R") > 0 Then
k = k + 1
If k = 1 Then
Cells(x, "c") = Sheets("考勤表").Cells(2, j) & "号"
Else
Cells(x, "c") = Cells(x, "c") & "," & Sheets("考勤表").Cells(2, j) & "号"
End If
End If
Next
Next
Next
Application.ScreenUpdating = True
End Sub 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询