I am not trying to get into programming debate in this thread... So please save yourself of the time of typing out a counter argument if you have one; I am set in my ways, even if your right its not going to change my opinion.
but here is why I really don't like using range, and especially selection.
I make programs that are used mostly by people who are not me and are constantly being changed and updated. Mostly they are data parsing programs where I get an XL file or text file and it spits out a nice data report. I have rules that I follow when I make a program.
1. absolute minimal dependence on the format of the data being inputed. The program should have intelligence to find and gather all the relevant information.
2. Only use dynamic arrays. The program should always work regardless of the size of data input.
3. Never show an empty Input Box. The program should always show a very good guess of what the user is going to input. This saves time and headaches if someone has to use the program over and over.
4. Never show Modal forms if possible. Modal forms are annoying. I like being able to scroll around on the excel and click and off different forms.
5. Access the excel sheet the minimum amount. Makes the code faster, and easier for me to update.
6.Never use Selection. Its slow. It can make wacky things happen if the user accidentally clicks the sheet.
So using the RANGE property usually implies that I already know the size and location of the sheet I need to access... This conflicts with rule #1.
The only time I do use RANGE is when I am setting borders, colors, merging cells at the output stage of things. But, I do it like this:
This way it is still dynamic.
I might be confused with how RANGE works with objects. My first assumption was that
would grab everything between those object locations, which is what I do not want. But after a closer look I think this not the case.
Bookmarks