Count a single cell across multiple sheets

danturv

New Member
Joined
Sep 11, 2013
Messages
23
Hi, I will try to explain this as best I can!
I have a workbook to track employees annual leave usage and entitlement, it has a sheet with a list of employees, a summary sheet showing holiday days taken/remaining etc and then a calendar type sheet for each employee with the days they have booked off. I have been asked to create another summary sheet to show how many employees have booked a particular day off, ideally someone could click on cell A5 in the new summary sheet and you get a count and a list of the employees sheets where A5 is not blank

Hopefully that makes sense and thanks in advance for any help offered
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
the example prints to immediate window (Debug.Print) , you can change it to anywhere.
Code:
'assuming the sheet name is the emp name
Dim ws As Worksheet
Dim i As Integer
Dim colEmps As New Collection
For Each ws In Sheets
If ws.Range("A5").Value <> "" Then colEmps.Add ws.Name
Next

For i = 1 To colEmps.Count
Debug.Print colEmps(1)
Next
MsgBox colEmps.Count & " want that day off"
Set colEmps = Nothing
 
Upvote 0

Forum statistics

Threads
1,214,868
Messages
6,122,005
Members
449,059
Latest member
mtsheetz

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top