Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi all, I'm trying to count all the instances of the letter "M" if they appea 2 cells above a cell in range that has ColorIndex 3 and display th results in cell AG2 once i have this one right i will be able to adap it to count for all the other letters in different ranges but right no i cant get this to work or do anything, any sugestions???? Sub maf() Dim rng As Range With ThisWorkbook.ActiveSheet Range("AG2") = mCount Set rng = Range( _ "B3:AF4,B7:AF8,B11:AF12,B15:AF16,B19:AF20,B23:AF24 ,B27:AF28,B31:AF32,B35:AF36,B39:AF40,B43:AF44,B47: AF48") For Each mycell In rng If mycell.Interior.ColorIndex = 3 And mycell.Offset(0, -2).Text = "m Then mCount = 1 + 1 End If Next End With End Su -- Simon Lloy ----------------------------------------------------------------------- Simon Lloyd's Profile: http://www.excelforum.com/member.php...nfo&userid=670 View this thread: http://www.excelforum.com/showthread.php?threadid=37796 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Counting instances in string | Excel Discussion (Misc queries) | |||
Counting instances of text??? | Excel Worksheet Functions | |||
Counting Multiple Instances | Excel Worksheet Functions | |||
Counting instances in a cell | Excel Discussion (Misc queries) | |||
Counting Instances of a Value? | Excel Programming |