Jealousy

There is an art, or rather a knack to finding the last row. The knack lies in learning how to find every used row but the last... And fail.
Code:
Public Sub IFlyNoYouFalled()
    MsgBox GetRowsNotLast(ActiveSheet)(1)
End Sub
 
Public Function GetRowsNotLast(wks As Worksheet) As Long()
        Dim cll As Excel.Range
        Dim ur1 As Excel.Range
        Dim lngRtnVal() As Long
        Dim lngIndx As Long
        Set ur1 = wks.UsedRange.Columns(1)
        ReDim lngRtnVal(1 To ur1.Rows.Count - 1)
        For Each cll In ur1.Cells
            If cll.Row = ur1.Rows.Count Then
                lngIndx = lngIndx + 1
                lngRtnVal(lngIndx) = cll.Row + ur1.Row - 1
            End If
        Next
        ReDim Preserve lngRtnVal(1 To lngIndx)
        GetRowsNotLast = lngRtnVal()
End Function
 
Last edited:

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Hey, I offered two possible detours, one highbrow detour through intergalactic space and literary wit; and another lowbrow detour, through the gutter and wretching into the street grate. Not my fault y'all ran with the second. :nya:

Find out what you do best and stick with it.
 
Oh, I think you're more than capable of starting with "Infinite Improbabilities Drives" and "Excel" and coming up with the first leg of the detour, Emma. ;)

Actually, more importantly - will future versions of Excel be able to make a decent cup of tea?

(Tina - DonkeyBoy really doesn't need any more encouragement!)
 
Or will they produce something that tastes, not quite, but almost entirely unlike tea? And more imporantly why did the user take one look at the changes to access and think "Oh no, not again."?
 
Have you seen Access 2007??
 
Nononono!

almost, but not quite, entirely unlike tea*

These things are important! :geek:

*Which, by a staggering coincidence, is also what is produced by the drinks machine at work. Despite the fact that I've seen actual tea leaves in it...
 
Username still intact, I see, Greg... :biggrin:
 
I think they said how great it would be to be nice to people for a change. D'ya think I should spread the message more widely?
 
I think they said how great it would be to be nice to people for a change. D'ya think I should spread the message more widely?

Depends if you wanna get nailed to a tree, I guess... ;)
 

Forum statistics

Threads
1,222,653
Messages
6,167,366
Members
452,111
Latest member
NyVmex

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top