Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Row number 1844 column C contains the integer 10.
I want to search back up row C (starting at row 1843) to count how many rows there are between row 1843 and the last time there was a 10 in row C. I would prefer a solution that uses VBA. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Sunday, May 17, 2015 at 6:33:28 PM UTC+10, wrote:
Row number 1844 column C contains the integer 10. I want to search back up row C (starting at row 1843) to count how many rows there are between row 1843 and the last time there was a 10 in row C. I would prefer a solution that uses VBA. Hi Claus, Thank you. It works beautifully. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Sunday, May 17, 2015 at 3:33:28 AM UTC-5, wrote:
Row number 1844 column C contains the integer 10. I want to search back up row C (starting at row 1843) to count how many rows there are between row 1843 and the last time there was a 10 in row C. I would prefer a solution that uses VBA. You may like this better as it fires when you enter a value and will work anywhere in the column '============= Option Explicit Private Sub Worksheet_Change(ByVal Target As Range) Dim tr As Long Dim MF As Range tr = Target.Row If Target.Column < 3 Then Exit Sub Set MF = Columns(3).Find(What:=Target, After:=Cells(tr, 3), LookIn:=xlValues, _ LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlPrevious, _ MatchCase:=False, SearchFormat:=False) If Not MF Is Nothing Then MF.Select MsgBox "Row " & Abs(MF.Row) End If End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Delete rows if time is greater than present time | Excel Programming | |||
Transpose 4 Columns data to Rows for Employee Time In and Time Out Schedule | Excel Programming | |||
what happened | Excel Worksheet Functions | |||
How can I calculate events that happened at the same time? | Excel Discussion (Misc queries) | |||
what happened | Excel Discussion (Misc queries) |