View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
T_o_n_y T_o_n_y is offline
external usenet poster
 
Posts: 43
Default mismatch error and Variants

It seems strange to me that you must declare each integer one at a time. But
if that's the way it must be done...

Anyway, thank you for the replies.

"mudraker" wrote:


Tony

Jim is correct if you declared your variables in your macros as you
have in your posted code
Dim i, j, k, l As Integer
It is only the last variable that is declared as a Integer

You need to use
Dim i as Integer
Dim J as Integer
Dim K as Integer

If you modify your declartions as above in all your macros

You can turn on the Option Explicit for all new workbooks & modules by
going to Tools Options Editor Tab Require Variable Declaration

or having the very 1st entry on your modules as
Option Explicit

Using this option saves a lot debugging problems


--
mudraker
------------------------------------------------------------------------
mudraker's Profile: http://www.excelforum.com/member.php...fo&userid=2473
View this thread: http://www.excelforum.com/showthread...hreadid=535794