Implementing Error Handling

There’s a potential problem with the procedure that you just saw: because it uses integers for both input and output, it’s possible for it to calculate a value greater than an integer will hold. For example, Figure 4.6 shows the result of trying to call Procedure22 with an input value of 20,000. Because this calculates an output value of 200,000, which is larger than an Integer variable can hold, a VBA overflow error occurs.