Hi Farid,
This will build your Score Card from your Working Data every time
Sub StaffScore(): Dim wsc As Worksheet, wfd As Workbook, ws As Worksheet
Dim r As Long, c As Long, k As Long, N As String, No As Integer
Set wsc = ActiveSheet: Set wfd = Workbooks("Working Data.xlsb")
r = wsc.Rows.Find("*", , , , xlByRows, xlPrevious).row
c = wsc.Columns.Find("*", , , , xlByColumns, xlPrevious).Column
Range(wsc.Cells(6, 2), wsc.Cells(6, c)).ClearContents
Range(wsc.Cells(7, 2), wsc.Cells(r, c)).Clear: r = 5
For Each ws In wfd.Worksheets
If r > 5 Then
wsc.Range("C" & r).EntireRow.Copy
wsc.Range("A" & r + 1).PasteSpecial xlPasteFormats
Application.CutCopyMode = False: End If
N = WorksheetFunction.Proper(ws.Cells(5, 2)): r = r + 1
wsc.Cells(r, 2) = r - 5: wsc.Cells(r, 3) = N
c = 4: k = 4: Do Until wsc.Cells(5, c) = ""
wsc.Cells(r, c) = ws.Cells(5, k): k = k + 2: c = c + 1: Loop
Next
Cells(r + 1, 1).Select
End Sub
Bookmarks