|
大佬们,这个代码在WPS中运行正常,到office中提示运行错误13:类型不匹配,做如何修改,求指导Private Sub CommandButton1_Click()Dim 研发人员, 循环, 计数, 循环2
For 研发人员 = 2 To 30
If (Sheets(Sheet2).Range("B" & 研发人员).Value = "") Then
Exit For
Else
计数 = 0
For 循环 = 2 To 100
If (Sheets(Sheet3).Range("D" & 循环).Value = "") Then
Exit For
Else
If (Sheets(Sheet2).Range("B" & 研发人员).Value = Sheets(Sheet3).Range("H" & 循环).Value) Then
If (Sheets(Sheet3).Range("K" & 循环).Value = "") Then
Else
计数 = 计数 + 1
End If
End If
End If
Next 循环
For 循环2 = 2 To 100
If (Sheets(Sheet4).Range("D" & 循环2).Value = "") Then
Exit For
Else
If (Sheets(Sheet2).Range("B" & 研发人员).Value = Sheets(Sheet4).Range("H" & 循环2).Value) Then
If (Sheets(Sheet4).Range("K" & 循环2).Value = "") Then
Else
计数 = 计数 + 1
End If
End If
End If
Next 循环2
Sheets(Sheet2).Range("D" & 研发人员).Value = 计数
End If
Next 研发人员
End Sub
|
|