freeisgood
New Member
- Joined
- Jan 18, 2008
- Messages
- 31
Hello All,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o></o>
<o> </o>
I am learning VBA and the material that I am reading provided me with an example along with a quick explanation. I understood variable “marks” and “d”. but for the 4<SUP>th</SUP> line of codes below “For Each c In marks”, does it means “c” represent each cell in the range of A1 to B10? If not please explain the meaning of that line.<o></o>
<o> </o>
Codes:<o></o>
<o> </o>
Dim marks, c, d<o></o>
Set marks = Range("A1:B10")<o></o>
d = 0<o></o>
For Each c In marks<o></o>
If c.Value < 40 Then<o></o>
d = d + 1<o></o>
End If<o></o>
Next c<o></o>
<o> </o>
Thank you<o></o>
VL<o></o>
<o> </o>
I am learning VBA and the material that I am reading provided me with an example along with a quick explanation. I understood variable “marks” and “d”. but for the 4<SUP>th</SUP> line of codes below “For Each c In marks”, does it means “c” represent each cell in the range of A1 to B10? If not please explain the meaning of that line.<o></o>
<o> </o>
Codes:<o></o>
<o> </o>
Dim marks, c, d<o></o>
Set marks = Range("A1:B10")<o></o>
d = 0<o></o>
For Each c In marks<o></o>
If c.Value < 40 Then<o></o>
d = d + 1<o></o>
End If<o></o>
Next c<o></o>
<o> </o>
Thank you<o></o>
VL<o></o>