با سلام
از این ماکرو هم میتوانید در شیت INDEX استفاده کنید
کد PHP:
Private Sub CommandButton1_Click()
Dim employee As String, total, total2, total3, total4, total5 As Integer, sheet As Worksheet, i As Integer, rng As Range
Z = Sheet1.Cells(Sheet1.Rows.Count, "a").End(xlUp).Row
Range("b2:b100").Select
Selection.ClearContents
Range("b3").Select
For J = 2 To Z
total = 0
employee = Range("A" & J).Value
For Each sheet In Worksheets
y = sheet.Cells(sheet.Rows.Count, "a").End(xlUp).Row
For i = 1 To y
If sheet.Range("A" & i).Value = employee And sheet.Name <> Worksheets("INDEX").Name Then
total = total + sheet.Range("B" & i).Value
End If
Next i
Next sheet
Sheet1.Range("B" & J).Value = total
Next J
End Sub
علاقه مندی ها (Bookmarks)