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: 1
Default Count If Is Like


Hi All,

I have a dilemma. I need to countif a range is like a value. I.e. I
need to count how many JUL appear in a certain range, the problem is
that the JUL may not always be in a cell on its own - it may have other
values such as JUL, AUG, SEP etc.

Is this possible to count. The code I currenty have is:

Sub countMth()
Dim i, ii As Long
Dim iii As Variant
Dim rR As Range
Dim C As Integer

C = 0

i = ActiveSheet.UsedRange.Cells.SpecialCells(xlCellTyp eLastCell).Row
'find stuff
Cells(1, 1).Select
ii = Cells.Find(What:="Month Appeared", After:=ActiveCell,
LookIn:=xlValues, LookAt:= _
xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:=True).Row
Cells(1, 1).Select
iii = Split(Cells.Find(What:="Month Appeared", After:=ActiveCell,
LookIn:=xlValues, LookAt:= _
xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:=True).Address, "$")


For Each rR In Range(iii(1) & ii + 1 & ":" & iii(1) & i)

If myCheck = rR.Value Like "JUL" Then
C = C + 1
End If
Range("A5") = C
Next rR


End Sub


--
moglione1
------------------------------------------------------------------------
moglione1's Profile: http://www.excelforum.com/member.php...o&userid=26414
View this thread: http://www.excelforum.com/showthread...hreadid=538458

 
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
Count Employee Work Time - Don't Double-count Overlapping Apts. J Excel Worksheet Functions 0 April 27th 07 05:52 AM
Excel 2000, count, sort a list & count totals? sunslight Excel Worksheet Functions 1 April 9th 07 05:46 PM
How do i count numbers and letters to find a total count of all Linda Excel Worksheet Functions 4 November 10th 05 04:51 PM
Count Intervals of 2 Numeric values in same Row and Return Count across Row Sam via OfficeKB.com Excel Worksheet Functions 12 September 24th 05 10:58 PM
Count Intervals of Filtered TEXT values in Column and Return Count across a Row Sam via OfficeKB.com Excel Worksheet Functions 9 July 31st 05 03:37 AM


All times are GMT +1. The time now is 04:18 PM.

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"