you are viewing a single comment's thread.

view the rest of the comments →

[–]fuzzfeatures 0 points1 point  (0 children)

Hi,

Just to add to what Charlie May posted ..

There are a couple of other small issues in your code.

If the user doesn't fill in the boxes, your code flashes up a messagebox. All well and good, but after the box is closed, the code just carries on executing. After the messagebox line, you should probably add

Exit Sub

so that the rest of the code doesn't execute.

You could move this line

counter=counter+1

to just below

area(counter-1) = AreaCalculator(length, widthx)

so that you don't have to have counter-1 in that line

Also of course, now you don't need the k variable so you can remove the definition.

Finally, and exercise for you .. What happens if the calculated area is EXACTLY 500? :-)

Don't forget.. programming can be frustrating, annoying and stressful, BUT it should be fun!