Find Which Block of 50 a Number Lies in; e.g. 100-150

Category:
Dates and Math
Type:
Snippets
Difficulty:
Intermediate
Author:
Anonymous

Version Compatibility: Visual Basic 6, Visual Basic.NET

More information:
This function returns a string indicating which block of 50 a number lies in. Examples: 50sRange 166 = "150-199" and 50sRange 325 = "300-350". To test this function, simply add a textBox control and a command button control to your form, then enter a number and click the command button.

Instructions: Copy the declarations and code below and paste directly into your VB project.

Declarations:

Code: