How does VBA Store Arrays

chazz

Board Regular
Joined
Jul 24, 2006
Messages
70
I put an array in my code last night. Then I noticed that, after I shut Excel down an restarted it, the array values had not been lost.

Is the array stored in permanent memory? I didn't try shutting the machine down, to see if it survived that.

??
 
Ha ha ha.....

Code:
Sub test()
Dim myGirl As Object, Drunk As Boolean

Randomize  ' I should have added this line anyway...

For Each myGirl In myGirls
      With myGirl
           If .Style = "Excelent" And _
              .Weight <= Me.Weight * 0.5 And _
              .Speach = "Witty" And _
              .Welth = "Rich" Then
           If Me.Drunk Then Call ForgetAboutIt
           End If
      End With
Next

End Sub
 
Upvote 0

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
jindon,

Code:
           If .Style = "Excelent" And _ 
              .Weight <= Me.Weight * 0.5 And _ 
              .Speach = "Witty" And _ 
              .Welth = "Rich" Then 
           If Me.Drunk Then Call ForgetAboutIt

I got errors on these lines but I corrected with more beer and a spell check.

Dufus
 
Upvote 0
Password generator works absolutely as intended -- even better, actually, thank you.

The original question had nothing whatsoever to do with the scope of the array. Perhaps I am the idiot you intimate that I am, however, you still couldn't get my question.

SydneyGeek did, though, and very plainly and without rancor answered the entire thing and gave me some useful information besides. Thank you.

Smartasses need not respond.
 
Upvote 0
Password generator works absolutely as intended -- even better, actually, thank you.

The original question had nothing whatsoever to do with the scope of the array. Perhaps I am the idiot you intimate that I am, however, you still couldn't get my question.

SydneyGeek did, though, and very plainly and without rancor answered the entire thing and gave me some useful information besides. Thank you.

Whatever you say.......
Smartasses need not respond.

Smartness need not to tell everything
 
Upvote 0
Chill Chazzy. You provided us smart-arses with a good foundation to build some comedy relief! If you really want to know how VB stores arrays, do a Google search for the SAFEARRAY structure.
 
Upvote 0
chazz

What exactly is your problem? :unsure:

You had the same attitude in your thread regarding RTD.

Please remember this is a free forum, where members offer free advice in their free time. (Or maybe when there's a quiet moment at work)

We try to help everyone but we can't help people unless they help us by giving information, answering questions etc.

Like Tom said 'Chill'. :whistle:
 
Upvote 0
well, i have a minute, so I'll go over it for the third or fourth time.

i asked a question about storing an array. I mentioned that it was inspired by a random number quirk. I solved my random number quirk. And yet, I kept being told by this generous band of congenial experts that I needed to do this and that to "fix" my random number issue, which was really a non issue.

A few posts later, somebody actually understood the question and attempted to answer it. In the mean time, I tried, patiently and politely, to reiterate my question.

Now, of course, I have "a problem." Well, yes, in this particular warp of reality, I guess I do.

Thanks to those who were paying attention, and didn't castigate me for not changing my responses to fit their personal read on my posts.
 
Upvote 0
Actually, Jindon answered your question correctly before Denis did. In fact, Denis himself pointed that out by quoting and restating Jindon's post.

Yet, you had no problems understanding Denis's post but couldn't -- or wouldn't -- Jindon. Go figure!
well, i have a minute, so I'll go over it for the third or fourth time.

i asked a question about storing an array. I mentioned that it was inspired by a random number quirk. I solved my random number quirk. And yet, I kept being told by this generous band of congenial experts that I needed to do this and that to "fix" my random number issue, which was really a non issue.

A few posts later, somebody actually understood the question and attempted to answer it. In the mean time, I tried, patiently and politely, to reiterate my question.

Now, of course, I have "a problem." Well, yes, in this particular warp of reality, I guess I do.

Thanks to those who were paying attention, and didn't castigate me for not changing my responses to fit their personal read on my posts.
 
Upvote 0
This is getting rediculous but I feel compelled to ... oh well.... just think about this.

Jindon said:
Rnd function returns the same when you refresh it without Randomize statement.
Dennis said:
3. You saw the same array values because Rnd() always starts with the same seed value unless you add the RANDOMIZE line.
Mehta said:
Actually, Jindon answered your question correctly before Denis did. In fact, Denis himself pointed that out by quoting and restating Jindon's post.
Yet, you had no problems understanding Denis's post but couldn't -- or wouldn't -- Jindon. Go figure!
Those two statements may have the same meaning, I can't tell. But, surely reasonable people can see that there is some difference too. Now, I've seen some of Jindon's work and I've stolen quite a bit from Mehta so don't take this the wrong way. I respect both of these experts. Finally we see this...
Chazz said:
Smartasses need not respond.
Jindon said:
Smartness need not to tell everything
I deal with similar communication issues in the course of my work. People WILL get frustrated when they don't understand and people WILL get frustrated when they are misunderstood. It just happens.

Sometimes it's a language barrier caused by level of experience and sometimes it's a result of being under pressure to get the job done. Sometimes the wife just got through beating... well you get the picture.

Now, I want all of you to shake hands and let it go. Go ahead, it's the right thing to do....

Dufus
 
Upvote 0

Forum statistics

Threads
1,215,063
Messages
6,122,928
Members
449,094
Latest member
teemeren

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top