Jealousy

...I do try to consider all worlds before I respond to question.

I used to do that too, but it was taking me ages, and eventually I decided to simply assume that Excel works the same on Mars and Jupiter as it does on Earth.
:biggrin::biggrin::biggrin:

But if anyone wants to hijack this thread into a whole new orbit, feel free to explain why it might be different . . . .
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
Maybe it's a gravity thing - does End(xlUp) go further on the Moon than on Mars? :)
 
Depends where you started from... ;)
 
Working with Dates could prove to be something of an issue anywhere other than Earth...
 
Measure in Earth standard days, obviously the rotational period of any other place would knacker a watch as Arthur Dent found out
 
rofl @ End(xlUp) * Gravity

That sort of made me think of another facet in this whole conversation. Sledgehammers (another one I am "occasionally" guilty of) :) I once saw (participated in) a whole thread on the "best" way to get the botton row. (It's this by the way: )
Code:
Private Function GetBottomRow(ByVal sh As Worksheet) As Long       
        GetBottomRow = sh.UsedRange(sh.UsedRange.Count).Row 
End Function
 
Last edited:
I would disagree that that is the best way, though I am open to argument. Much time and energy has been spent overcoming Excel's occasional delusions as to what the UsedRange actually is! :)
 
Oorang - doesn't that find the lowest row with data or formatting, rather than the lowest row with data?
 
What started the whole discussion was the used of Range("A65536").End(xlUp) could miss data in excel 2007 (if there are more than 65536 rows), but if you used a larger number then it wouldn't be cross compatible with earlier versions. Yes, if you have "dirty" data then usedrange can grab cells with no data... But I submit that any worksheet not having clean usedrange, is probably also not clean enough for automation without scrubbing anyway.
And for the purpose of the scrub itself you can always do a reasonably quick test of LenB(cll.Value) to shrink the range. The chief advantage being that usedrange will always get all of the data, where end(xlup) can miss data, both because of versioning problems, or because of presumption that you are using the longest column. If your data in not fully normalized (as may be the case in a scrub) then you might zoom right up past data by using too short of a column. The general principle being it was deemed better to have all the data + non-data cells, then miss data completely.
 
Last edited:

Forum statistics

Threads
1,222,665
Messages
6,167,491
Members
452,113
Latest member
GunsofBrixton

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