ThrottleWorks
Excel Ninja
Hi,
I am trying to populate Age Bracket.
I am trying to populate these by using Loop.
I do not know how to define "from" and "to" in a loop.
For example how do I define greater than 7 and lesser than 16 in a Loop.
I tried doing it by "If Rng.Value > 7 And Rng.Value < 16 Then" but it's not working.
I am aware that I can populate it by using formula but is there a way where I can define values mentioned below.
Can anyone please help me in this.
I am trying to populate Age Bracket.
I am trying to populate these by using Loop.
I do not know how to define "from" and "to" in a loop.
For example how do I define greater than 7 and lesser than 16 in a Loop.
I tried doing it by "If Rng.Value > 7 And Rng.Value < 16 Then" but it's not working.
I am aware that I can populate it by using formula but is there a way where I can define values mentioned below.
Can anyone please help me in this.
Code:
For Each Rng In Rng6
If Rng.Value <= 7 Then
Cells(Rng.Row, LastCol3).Value = "0-7"
End If
If Rng.Value > 7 And Rng.Value < 16 Then
Cells(Rng.Row, LastCol3).Value = "8-15"
End If
Next