# Thread: [RESOLVED] How to check counter for particular numbers

1. ## [RESOLVED] How to check counter for particular numbers

When the counter is 4, 7, 10, 13, 16, 19, 22, etc, etc, etc for as many counts as needed I need to do something slightly different on those particular count values. How do I check for those values without using a bunch of If statements or a Select Case?

2. ## Re: How to check counter for particular numbers

Determine the pattern, and create a check based on it.

In this case they seem to be multiples of 3, plus one... so check for that.
Code:
```If (x - 1) Mod 3 = 0 Then
'4 etc
Else
'Other numbers
End If```

3. ## Re: How to check counter for particular numbers

That works and I tried it however it also includes 0 which I can overcome by just checking if number is > 1 but I was just thinking if there is a way without the additional If x > 1 Then

x=1
If (x - 1) Mod 3 = 0 Then

4. ## Re: How to check counter for particular numbers

Adding >1 is the easiest way.

5. ## Re: How to check counter for particular numbers

Thanks, si. I'll use your code.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•