Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
in row A i have dates (multiple, but ascending)
i need to find the row that first contains a date and the last row that contains that same date thanks in advance |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Assuming your data is in A1:A16, then for the first use:
=MATCH(A1,$A$1:$A$16,0) and last =MATCH(A1,$A$1:$A$16,1) Note that this returns the position with respect to the array selected. Please adjust the value by adding the rows to each formula if you are not starting at top. For e.g. your start from A2, then add 1 to both formulae. Mangesh "choice" wrote in message ... in row A i have dates (multiple, but ascending) i need to find the row that first contains a date and the last row that contains that same date thanks in advance |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Choice,
Try this macro if this works for you. 1. Select all data or range you are interested to find and run the macro below. Sub SelectStringCells() Dim rCell As Range Dim IString As String Dim rSelected As Range IString = "1/12/2001" Set rSelected = Nothing For Each rCell In Selection If rCell.Value = IString Then If rSelected Is Nothing Then Set rSelected = rCell Else Set rSelected = Union(rSelected, rCell) End If End If Next If rSelected Is Nothing Then MsgBox "No cells value match" Else rSelected.Select MsgBox "Found the Dates" End If Set rCell = Nothing Set rSelected = Nothing End Sub Hope this helps. "choice" wrote: in row A i have dates (multiple, but ascending) i need to find the row that first contains a date and the last row that contains that same date thanks in advance |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Find number of weekdays and wekend days given a total number of da | Excel Discussion (Misc queries) | |||
Find previous number and find next number in column | Excel Discussion (Misc queries) | |||
Need Cells.find to find first number in a row which is 8000 | Excel Discussion (Misc queries) | |||
countif formula to find the occurances of a number that is greater than one number but less than another | Excel Discussion (Misc queries) | |||
find and delete text, find a 10-digit number and put it in a textbox | Excel Programming |