View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Tushar Mehta Tushar Mehta is offline
external usenet poster
 
Posts: 1,071
Default Nesting limits in VBA

Hi Tom,

In article ,
says...
how to make it flatter would depend on the criteria - if they don't have to
checked sequentially, then use the And statement

if 1< i and 2 < i and 3 < i and 4 < i and 5 < i and 6 < i then

end if

as an example.


Alternatively, just reverse the tests...

If i15 then
ElseIf i 14 then
ElseIf i 13 then
....
elseif i1 then
else
end if
--
Regards,

Tushar Mehta, MS MVP -- Excel
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions