Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
sm sm is offline
external usenet poster
 
Posts: 13
Default I want to count rows between the occurence of one word.

I need to count rows between the occurence of one word - eg. "ticket".
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default I want to count rows between the occurence of one word.

Try something like the following:

Dim FirstFind As Range
Dim SecondFind As Range
Dim RowsBetween As Long
Set FirstFind = Range("A1:A100").Find(what:="ticket",
LookIn:=xlValues, _
lookat:=xlWhole, MatchCase:=False)
If Not FirstFind Is Nothing Then
Set SecondFind = Range("A1:A100").FindNext(after:=FirstFind)
If Not SecondFind Is Nothing Then
RowsBetween = SecondFind.Row - FirstFind.Row - 1
Debug.Print RowsBetween
End If
End If



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


"SM" wrote in message
...
I need to count rows between the occurence of one word - eg.
"ticket".



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 301
Default I want to count rows between the occurence of one word.

if ticket is in column D:
=MATCH("ticket",OFFSET(D1,MATCH("Ticket",D:D,0),0, 10000,1),0)-1
Bob Umlas

"SM" wrote in message
...
I need to count rows between the occurence of one word - eg. "ticket".



Reply
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 occurence of values Vic Excel Discussion (Misc queries) 1 August 14th 09 12:56 PM
count how many rows a word appears in learningaccess Excel Worksheet Functions 1 February 12th 09 09:48 PM
Formula to count occurence between two rows John Blackwell Excel Discussion (Misc queries) 8 September 16th 08 05:20 PM
VB count word occurence in variable size sheet JBW Excel Worksheet Functions 5 September 25th 07 01:54 PM
Count the occurence of more than one condition wutang1105 Excel Worksheet Functions 1 August 26th 05 07:21 PM


All times are GMT +1. The time now is 11:21 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"