Explanation of 'Counters'

Ddangelo

New Member
Joined
Dec 17, 2013
Messages
16
Hello! I'm trying to decode what a previous intern did in his code, and as an intern myself I'm trying to learn as much as I can! Below is part of his code, and I am very confused on what counters are, and what his list means at the bottom ( i = 0 , j = 0 , etc.) Thanks for any help!



Function winRatioGen()
Dim cell As Range 'array for each row

'declear an array for each frame size. Can only fit 500 points. update as necessary
Dim Frame10(500) As Double
Dim Frame15(500) As Double
Dim Frame20(500) As Double
Dim Frame25(500) As Double
Dim Frame29(500) As Double
Dim Frame32(500) As Double
Dim Frame38(500) As Double
Dim Frame46(500) As Double
Dim Frame56(500) As Double
Dim Frame60(500) As Double
Dim Frame70(500) As Double
Dim Frame78(500) As Double
Dim Frame88(500) As Double
Dim Frame103(500) As Double
Dim Frame110(500) As Double

'counters for rows and each frame size.
i = 0
j = 0
k = 0
l = 0
m = 0
n = 0
o = 0
p = 0
q = 0
r = 0
s = 0
t = 0
u = 0
v = 0
w = 0
x = 0
y = 0
z = 0
a = 0
b = 0
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
this looks like a possible continuation of http://www.mrexcel.com/forum/excel-questions/748175-visual-basic-applications-question.html


Ddangelo

here is a real world example of an array and array counters ( sort of )

i hope that it is not too childish

imagine that you have a box that has 500 compartments

each compartment can hold a number of marbles

your job is to store handfuls of marbles that people give you

you must store each handful in a separate compartment

you must fill the compartments in sequence

you cannot reach out and dump marbles into an empty compartment, you have to dump the marbles into a funnel

on the front of the box is a dial which sets the destination compartment number for the funnel

so you start your day at the marble repository :LOL:

you dial the box so that the funnel points to the next empty compartment,
because when your hands are full of marbles, then it is hard to dial

customer comes by and gives you a handful of marbles, which you dump into the funnel,
give the customer a ticket containing box and compartment numbers,
and then you dial next empty compartment, so that you are ready for next customer

now imagine that you have a bunch of these boxes

each dial is separate from all the other dials

each dial holds a separate value, some are equal to other dials, some are not equal to other dials



each of the boxes can be thought of as an array

the dial on each box can be thought of as an array counter (pointer)
 
Last edited:
Upvote 0
hiker - Thank You very much! This is great information.

One general question to anyone. Since I have a MAC desktop, and I'm really serious about Excel, Access, etc., everything in Office, do I pretty much need to get a PC/non-Mac? If I want to learn MS Office, don't I have to get a PC for windows? I know there is a version for Mac, but someone, I think, stated earlier, that I won't be able to do a lot of the same things in the MAC version than in MS Office for windows. Help, please.....!!
 
Upvote 0
goldhelmet25,

Thanks for the feedback.

You are very welcome. Glad I could help.

And, come back anytime.


Since I have a MAC desktop

I do not have any experience with a MAC.


Click on the Reply to Thread button, and just put the word BUMP in the thread. Then, click on the Post Quick Reply button, and someone else will assist you.
 
Upvote 0

Forum statistics

Threads
1,213,527
Messages
6,114,142
Members
448,551
Latest member
Sienna de Souza

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