View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Jim Cone Jim Cone is offline
external usenet poster
 
Posts: 3,290
Default selected range has different cell formatting


All thought, I have 4 different XL versions installed, I rely on XL 97 version help.
There is no wait while it decides to appear, usually provides the information
asked for (not something else) and is far better organized.
The instructions work in all current versions, while some xl 2003 help,
does not apply to earlier versions.

From XL97 VBA Help...
'---
"Row Property
Returns the number of the first row of the first area in the range. Read-only Long."

"Integer variables
are stored as 16-bit (2-byte) numbers ranging in value from -32,768 to 32,767"

"Long (long integer) variables
are stored as signed 32-bit (4-byte) numbers ranging in value from
-2,147,483,648 to 2,147,483,647.
'---

One of the things in this world you can rely on is, that once you release a program
for general use, it will be used in ways you never anticipated. Also, using an Integer
data type for a row number, forces Excel to convert it to a Long before use.

I would not wait for the IT department - buy a used copy of any version of John
Walkenbach's Power Programming for Excel books - you will be glad you did.

Jim Cone
San Francisco, USA




"Tendresse"

wrote in message
Hi Jim, thank you very much for your reply. Much appreciated.
Well, about reading the Help file, the IT dept in our organisation haven't
installed the help files for VBA on our computers and have somehow locked
access to online help! Which is very frustrating. So until i get my Access
Request (that i put forward to them) processed, i'm depending on information
through the Discussion Group.

In relation to your comment about using a Long data variable for row numbers:
Doesn't Integer values cover numbers from -32,768 to 32,767 (please correct
me if i'm wrong)? Do I still need to using Long data variable even if i'm
pretty sure that the number of used rows in my spreadsheets will never reach
32,767?

I'm actually glad that you raised this point because i often wondered if i
understood it correctly.

Thanks again for your help
cheers