LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to count in between gap?

merjet wrote:
* Is it possible to use input box insteading of definining
everything
inside the module itself, so that it will be more friendly user.


Sub macro1()
Dim str1 As String
Dim str2 As String
Dim c As Range
Dim rng As Range
Dim iCt As Integer

str1 = InputBox("What do you want to search for?")
str2 = InputBox("In what range, e.g. A1:A10?")
Set rng = ActiveSheet.Range(str2)
For Each c In rng
If c = str1 Then
iCt = iCt + 1
If iCt = 1 Then ActiveSheet.Cells(1, 3) = str1
ActiveSheet.Cells(1, 3 + iCt) = c.Row
End If
Next c

End Sub


HTH,
Merjet *


I need to check more than one cell conditions, lets say 3 cells value
then what should I do ?

Thanks
Michael168



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/



 
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 03:52 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"