FOR NEXT LOOP QUESTION

dabluebery

Board Regular
Joined
Sep 22, 2003
Messages
83
Hey,

I'm in a VBA class, and I have a simple HW assignment that I don't quite understand. Here's the question;

Write a sub that asks for a product index from 1 to 100. Embed this within a Do loop so that the user keeps being asked until he enters an integer from 1 to 100. (use a For loop for checking)

I don't understand how I would use a for loop to check if the number is an integer. I understand the first part of the question, and already have a do loop checking if the value entered is numeric. If not, it prompts an input box until you do. Any insight is appreciated.

Rob
 
I thought you were being sarcastic.

I was still talking about Excel and VBA.

I don't understand any of this:

The Microsoft statement ("The disadvantage is that variant variables require at least 16 bytes of memory, which can be significant in large procedures or complex modules.") is not relevant in that the subject procedure is neither large nor complex.
(Also, assertions by Microsoft are not necessarily always reliable.)
How is this not relevant to Excel and VBA? The statement isn't large or complex, nor is that what they are saying, it's refering to large and complex procedures. It does not mean that such practices do not apply to small procedures. Microsoft may not always be 100% accurate in their support, but, they did create Excel, making them somewhat credible in my estimation.
Nor do I understand:
Also, can we mind the tone and nature of our discussions in this forum somewhat? Go argue in the lounge.
This forum is to discuss VBA and Excel, I'll continue to argue/debate/discuss (whatever) Excel & VBA here, thank you.

Irrespective of why you mentioned of dates, in actuality, I don't care, I vote to trap it all and use a variant, hence my revision. And I really don't see anything from my posts to this thread coming close to the tone you've demonstrated in this thread.
 
Upvote 0

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
I thought you were being sarcastic.
Who me?

I don't understand any of this
Don't get disheartened - you will probably get there eventually.

How is this not relevant to Excel and VBA?
Did someone say it wasn't?

The statement isn't large or complex, nor is that what they are saying, it's refering to large and complex procedures
Did someone say otherwise?

it's refering to large and complex procedures
Which is what the procedure in this thread is not - so the potential saving in memory is 6 bytes, which I don't think is worth all this crap that is being posted.

Nor do I understand:
Also, can we mind the tone and nature of our discussions in this forum somewhat? Go argue in the lounge.
Merely paraphrasing your previous snotty remark. I do not believe you have exclusive entitlement to telling posters what and where to post.

Irrespective of why you mentioned of dates, in actuality, I don't care
Don't care about what?

I vote to trap it all and use a variant, hence my revision.
Extreme overkill in my opinion.

And I really don't see anything from my posts to this thread coming close to the tone you've demonstrated in this thread.
Again, don't be disheartened. With a little more experience and effort I'm sure you will eventually be able to get closer.
 
Upvote 0

Forum statistics

Threads
1,214,918
Messages
6,122,241
Members
449,075
Latest member
staticfluids

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top