ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Variable Decleration (https://www.excelbanter.com/excel-programming/365849-variable-decleration.html)

Christmas May[_2_]

Variable Decleration
 
I tried "DIM A$ AS STRING" which produced an error.

1) How do you initalize/define a string variable?

2) What is the proper way to initalize all other types of variables?

3) Does VBA really restrict things to integers, bytes, boolean expressions,
etc, or are they still variants?

Thanks in advance,

Christmas May

Jim Thomlinson

Variable Decleration
 
Here is everything you ever wanted to know about delcaring variables...

http://www.cpearson.com/excel/variables.htm

You will run into difficulty because of the use of the $ sign...

dim a as string
or
dim a$

Either of which will declare a string.
--
HTH...

Jim Thomlinson


"Christmas May" wrote:

I tried "DIM A$ AS STRING" which produced an error.

1) How do you initalize/define a string variable?

2) What is the proper way to initalize all other types of variables?

3) Does VBA really restrict things to integers, bytes, boolean expressions,
etc, or are they still variants?

Thanks in advance,

Christmas May


Christmas May[_2_]

Variable Decleration
 
Mr. Jim Thomlinson,

1) Thanks for the link!

2) Thanks for the assistance with string variables. (Darn Quickbasic 4.0
habits)

3) I'm considering this matter closed, unless someone else wishes to add
commentary.

Sincerely,

Christmas May



"Jim Thomlinson" wrote:

Here is everything you ever wanted to know about delcaring variables...

http://www.cpearson.com/excel/variables.htm

You will run into difficulty because of the use of the $ sign...

dim a as string
or
dim a$

Either of which will declare a string.
--
HTH...

Jim Thomlinson


"Christmas May" wrote:

I tried "DIM A$ AS STRING" which produced an error.

1) How do you initalize/define a string variable?

2) What is the proper way to initalize all other types of variables?

3) Does VBA really restrict things to integers, bytes, boolean expressions,
etc, or are they still variants?

Thanks in advance,

Christmas May



All times are GMT +1. The time now is 01:11 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com