Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why the For... Next doesn't take value from 100 to 299?

Status
Not open for further replies.

gulong

Technical User
Sep 10, 2001
4
CH
I created a For...Next loop that takes values from three VBA textbox. ex:

For i = Starting.Text To Ending.text Step q.text

If ... Then V.Text = i
....
next i

It works from 1 to 99, but doesn't work from 100 to 199, works again from 200 to 999, but doesn't work from 1000. Can anybody share a light on this? Thank you very much. (The values are Ending.text, with step q.text being 1.)
 
Make sure you are getting numbers and not strings from the text boxes; Check out help on CStr(), CInt(), CSng, and CLng() functions....
 
Also you really don't need the part of 'Step q.text' part if your increment for each loop is 1. VB defaults the step to 1 even if you don't declare it at the for loop statement.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top