Loop inside a loop or Nested Loop in VBA

2644
28
Jump to solution
04-05-2013 05:07 AM
MichelleCouden1
Occasional Contributor III
I need help with a loop. I need it to do 2 things and I'm not sure how to write  a double loop. Would my code look like this :

If cboStations.Text = "Urban" then
   If cboYears.Text = "2010" then
    cboDistricts.AddItem "Abilene"
0 Kudos
28 Replies
KenBuja
MVP Esteemed Contributor
Thanks Leo!

The code I provided yesterday will allow the user to change the stations and the years and get a new list.
0 Kudos
MichelleCouden1
Occasional Contributor III
Leo, I'm not quite sure what you mean on thanking Ken?? I thanked him many, many times in the last post. I am always grateful for the help you guys provide me because I am new at programming and right now I need the help. The post that was of no help was from a scjpike not Ken. scjpike sent me a link and there was nothing on it that I could find to help with this program.
Ken, thank you again for helping me I really do appreciate it. I found my mistake and I have corrected it. It works beautifully. I am sorry. I missed a step that needed to be typed out. Thank You again. Hope you all have a good week.
0 Kudos
KenBuja
MVP Esteemed Contributor
What Leo meant was to start marking which posts were helpful and which one actually answered your question. You often mark your own posts as the correct answer, but rarely do that for other contributors. This doesn't encourage people to help you out very much. Please take a look at the Esri blog post on the MVP program.

Note the following:


Any logged in user can use the �??arrow�?� icons on the far right to vote  for any of the              replies on any threads if they believe that reply contains  useful information.  Users may vote for more than one              reply in a thread. This voting tool allows the ArcGIS user  community as a whole to collectively bubble the best replies              to the top of the thread.  This does two things:            

  • It allows other users later to find the most useful  information most quickly without necessarily reading all of the posts in  the thread.

  • It rewards the reply�??s author with points that  contribute to their status within the community, allowing other users to  identify the most helpful members of the community, building trust and  encouraging collaboration.

LeoDonahue
Occasional Contributor III
Sorry Michelle,

I read some of your comments like:  "Hey Ken where are you?"  and "All *we* have to do is fix this.."

I understand you are trying to learn VBA, but it can appear to casual readers that you are waiting for Ken to fix your problem.  Bring something to the table.  And you haven't acknowledged him at all with the tool the forum provides to do so. 

I ended up getting the first helpful post in this thread and I didn't even do anything - my guilt will set in later today I'm sure.
0 Kudos
KenBuja
MVP Esteemed Contributor
I ended up getting the first helpful post in this thread and I didn't even do anything - my guilt will set in later today I'm sure.


No need for guilt, Leo...that was me marking it as helpful 🙂
MichelleCouden1
Occasional Contributor III
I understand I always make the right comment. I will definitely be more attentive to my comments. Thanks to you both for continuing to teach me the rules and ways of the forum and of VBA. I will most certainly use the post icons.
LeoDonahue
Occasional Contributor III
Michelle,

Seriously, I think people like you, but stop marking your own post as the answer.  You need to mark one of Ken's replies as the answer.
KenBuja
MVP Esteemed Contributor
I understand I always make the right comment. I will definitely be more attentive to my comments. Thanks to you both for continuing to teach me the rules and ways of the forum and of VBA. I will most certainly use the post icons.


And yet you mark your own post as the correct answer? I think you need to reread that blog.



With my status as a forum moderator (obtained by having users mark my posts as the correct answer when appropriate), I have gone ahead and changed the correct answer indicator since you are unwilling to do that.
0 Kudos
LeoDonahue
Occasional Contributor III
I doubt it will be the last time.

There are alot of uncredited answers throughout the forums.  Just the way it goes some days.
0 Kudos