Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- https://excel-egy.com/forum/t4363
- ---------------------------------
- Sub Count_Items_SUM_Total_By_Sheet_Name_As_Date()
- Dim ws As Worksheet, sDate As String, lr As Long, c As Long
- Application.ScreenUpdating = False
- Set ws = ThisWorkbook.Worksheets("Sheet1")
- ws.Range("D7:L8").ClearContents
- sDate = Format(ws.Range("H3").Value2, "dd-mm-yyyy")
- If Evaluate("ISREF('" & sDate & "'!A1)") = False Then Exit Sub
- With ThisWorkbook.Worksheets(sDate)
- lr = .Cells(Rows.Count, "C").End(xlUp).Row
- For c = 4 To 12
- ws.Cells(7, c).Value = Application.WorksheetFunction.Count(.Range(.Cells(7, c), .Cells(lr - 1, c)))
- ws.Cells(8, c).Value = .Cells(lr, c).Value
- Next c
- End With
- Application.ScreenUpdating = True
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement