View Single Post
  #12   Report Post  
Posted to microsoft.public.excel.programming
Claus Busch Claus Busch is offline
external usenet poster
 
Posts: 3,872
Default Compare 2 Lists and Take an Action Q

Hi Sean,

Am Mon, 21 Nov 2016 08:09:06 -0800 (PST) schrieb :

For i = 2 To LBound(varA) ' start in row 2 to allow for headers
For j = 2 To LBound(varB) ' start in row 2 to allow for headers


you have to loop from second value to last value. The last value of an
array is Ubound *NOT* LBound
Change the two lines to:
For i = 2 To UBound(varA) ' start in row 2 to allow for headers
For j = 2 To UBound(varB) ' start in row 2 to allow for headers


Regards
Claus B.
--
Windows10
Office 2016