Quantcast
Channel: What is wrong with this variable with initial value , Excel VBA - Stack Overflow
Browsing latest articles
Browse All 4 View Live

Answer by Running Forward for What is wrong with this variable with initial...

In VBA the above format is not possible only constants can be used like this : Const yearnr As Integer = 18 you can use Dim yearnr As Integer yearnr = 18 Public yearnr As Integer yearnr = 18

View Article



Image may be NSFW.
Clik here to view.

Answer by user2140261 for What is wrong with this variable with initial value...

Looking at the Question in my comment, For you needs it would be: Dim yearnr As Integer: yearnr = 18 you can make it one line with the : character

View Article

Answer by dezzie for What is wrong with this variable with initial value ,...

Excel doesn't let you initialize values at declaration as they're already initialized to zero. To do what you want just break it up into two lines. Dim yearnr As Integer yearnr = 18

View Article

What is wrong with this variable with initial value , Excel VBA

I dot know why, Excel throws an error at this line: Dim yearnr As Integer = 18 I want to declare a variable and assign a initial value. Please tell me why it is not working.

View Article
Browsing latest articles
Browse All 4 View Live




Latest Images