LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 144
Default Counting times a value occurs

I'm sure I'm an idiot but I can't get this to work. I need to have the code
count the number of times a name occurs in a given selection. The code below
should give you an idea of what im working on, column 15 is a list of
employees and if the month its calculating is may then the range below is the
range inwhich the employee could be scheduled in may.

If UserForm1.calcMay.Value = True Then
EmployeeRow = 2
Do Until ActiveSheet.Cells((EmployeeRow + 1), 15).Value = Empty
EmployeeRow = EmployeeRow + 1
employee = ActiveSheet.Cells(EmployeeRow, 15).Value
shifts = Range("A4:N8,A10:N14,A16:N20,A22:N26,A28:F32").
Count(employee)
ActiveSheet.Cells(EmployeeRow, 16).Value = shifts * 8

Loop

Thanks for the help,
jordan
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Counting number of times name occurs between two dates Basenji Excel Worksheet Functions 2 February 25th 10 10:22 PM
counting no. of times a character occurs in a cell hsg Excel Worksheet Functions 3 March 24th 09 06:49 PM
Counting number of times a value occurs da Excel Discussion (Misc queries) 6 September 9th 08 03:51 PM
Counting the number of times more than 1 variable occurs chrisdedobb Excel Discussion (Misc queries) 5 January 3rd 06 06:20 PM
I would like to count the # of times a value occurs in Col B base shopaholic Excel Worksheet Functions 3 December 9th 05 04:25 PM


All times are GMT +1. The time now is 02:10 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"