Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Referencing the "Find Largest Number" thread posted earlier this morning, I
redveloped the code to make it work better: Sub TestAddendum() Dim i As Long Dim a As Integer Dim row As Long Dim Rng As Range Dim LastRow As Long LastRow = Range("A10000").End(xlUp).row a = InputBox("EO#") Set Rng = Columns(2).Find(a) For row = 0 To LastRow If Rng < 0 Then MsgBox a & " " & Rng.Offset(row, 1) End If If Rng.Offset(row, 0) < a Then MsgBox "All Done" Exit Sub End If Next End Sub I can get it to do all that I need (initially of course) except that before it "Exit Sub", it repeats the first entry. (example 28735 0 - 5, 28735 0, exit sub) 28734 0 28735 0 28735 1 28735 2 28735 3 28735 4 28735 5 28736 0 28737 0 How can I stop this after largest number in offset(row,1)? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to find largest value "<=" when array is in descending order? | Excel Worksheet Functions | |||
Function to find 'n'th largest alphanumeric field (like "Large") | Excel Worksheet Functions | |||
find/replace "cr" from end of number to "-" in front of number | Excel Discussion (Misc queries) | |||
HELP on "left","right","find","len","substitute" functions | Excel Discussion (Misc queries) |