LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
MWE MWE is offline
external usenet poster
 
Posts: 20
Default When DIM statements don't work

I have been using VBA for several years. This may be a
really stupid question, but I have recently encountered a
funny phenomena. I use have always assumed that you
could "stack" variables of the same type in a DIM
statement. For example

Dim A, B, C as Integer
and
Dim A as Integer
Dim B as Intger
Dim C as Integer

would have the same effect, i.e., all variables would be
of type Integer.

I now find that this appears to not be true and that some
variables in a multi-variable Dim statement are considered
Variants.

What is supposed to happen with a multi-variable Dim
statement? If only one of the variables is acutallly
types as I want, are the rest of type Variant? What is
the value of allowing multiple variables if they are not
typed the same?

Thanks
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
IF statements with * character doesn't work [email protected] Excel Worksheet Functions 5 November 8th 06 03:47 PM
IF Statements (Mutliple Statements) Deezel Excel Worksheet Functions 3 October 19th 06 06:13 AM
Getting multiple IF statements to work Psycho0426 Excel Discussion (Misc queries) 15 August 18th 06 04:31 PM
I'm desperate I posted earlier about "If" statements that don't work but are correct. Now... Marc Excel Worksheet Functions 2 April 5th 06 09:27 PM
Cant get totals to work with IF statements spelingchampeon Excel Worksheet Functions 4 October 9th 05 03:14 PM


All times are GMT +1. The time now is 12:16 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"