![]() ![]() Step 1: Write the subprocedure for VBA Type Mismatch. ![]() Let’s see another example of Type Mismatch. For this, follow the below steps: We will get the message as 10 which we assigned in variable A. Step 8: Run the code by pressing the F5 key or by clicking on the Play Button. Step 7: If we assign the correct value incorrect format to the variable we define, we will get the proper output. For directly compiling the code, press the F8 function key. If we consider the same code and compiled it before we run it, we would have got this error message earlier also. So giving it a text will definitely show the error. As we can see, we really got the error message as “Run-Time Error ‘13’” as shown below with the additional message as “ Type Mismatch”.Īs we already know that Integer can only store whole numbers. Step 6: Now run the code by pressing the F5 key or by clicking on the Play Button. Step 5: And to see the values stored in variable A we will use the Message box. But, just to demonstrate here we will be assigning a text value to variable A. Step 4: As we all know, Integer data type only stores numbers and that to Whole Numbers. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
January 2023
Categories |