Thread
:
Selecting last five numbers in a selection
View Single Post
#
2
Posted to microsoft.public.excel.misc
Don Guillett
external usenet poster
Posts: 10,124
Selecting last five numbers in a selection
try this idea
Sub lastfivenums()
mr = 5
For i = Cells(mr, Columns.Count).End(xlToLeft).Column To 6 Step -1
If Cells(mr, i) 0 Then
ms = ms + Cells(mr, i)
mc = mc + 1
If mc = 5 Then Exit For
End If
Next i
MsgBox ms
End Sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software
"Scott" wrote in message
...
I have a series of data in the same row, (F5:AC5) containing anywhere from
1
to 24 numbers. In cells AD5:AH5, I want to determine the LAST five
numbers
entered in the row of data (not smallest or largest, but simply the last
numbers that were entered in). There could be duplicate numbers, and
blanks
in between cells of numbers. How would I go about this?
Thanks.
Reply With Quote
Don Guillett
View Public Profile
Find all posts by Don Guillett