Thread: Countif
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default Countif

Change
ce.Offset(0, 1) = WorksheetFunction.CountIf(Range("k:k"),
ce.Value)
to
ce.Offset(0, 1) =
WorksheetFunction.CountIf(Worksheets("Sheet2").Ran ge("k:k"),
ce.Value)


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Busybee" wrote in message
...
Here is the statement I am using.

For Each ce In Range("a2:a" & Cells(Rows.Count,
1).End(xlUp).Row)
ce.Offset(0, 1) = WorksheetFunction.CountIf(Range("k:k"),
ce.Value)
Next ce

However the data in Range k:k is actually on a different sheet.
How do I get
it to look on sheet "Data Sheet" range k:k. Column a2:a is on
sheet "Sales
Reps". Thanks