Hi Anish

Its not the problem with "WHILE" or "WEND"

Make sure you have closed all "IF" conditions with "END IF" at proper places

Just check if you have started an IF condition inside the loop and tried to
close it after the loop

2009/10/26 Anish Shrivastava <anish....@gmail.com>

> Hello Experts..
>
> I m using While and Wend statement in my code and it has got more than 100
> if conditions. when I run the macro it says "WEND WITHOUT WHILE", it's
> buggin my head...and I don know wht's wrong. Could anyone of you please help
> me...
>
> Sample code...
>
> Sub dept()
> i = 1
> z = Cells(Rows.Count, "B").End(xlUp).Row
> While i <= z
> If Cells(i, 2).Value Like "*FINANCE*" Then
> Cells(i, 4) = "FINANCE / ACCOUNTING"
> Else
> If Cells(i, 2).Value Like "*ACCOUNTS*" Then
> Cells(i, 4) = "FINANACE / ACCOUNTING"
> Else
> If Cells(i, 2).Value Like "*SALES*" Then
> Cells(i, 4) = "SALES"
> *(IN BETWEEN THR R MORE THAN 100 IF CONDITIONS LIKE THIS)*
> endif
> endif
> endif
> i=i+1
> wend
> end sub
>
> -best
> ANISH
>
> >
>


-- 
Hemant Hegde

--~--~---------~--~----~------------~-------~--~----~
----------------------------------------------------------------------------------
Some important links for excel users:
1. Excel and VBA Tutorials(Video and Text), Free add-ins downloads at 
http://www.excelitems.com
2. Excel tutorials at http://www.excel-macros.blogspot.com
3. Learn VBA Macros at http://www.vbamacros.blogspot.com
4. Excel Tips and Tricks at http://exceldailytip.blogspot.com
 

To post to this group, send email to excel-macros@googlegroups.com
If you find any spam message in the group, please send an email to:
Ayush Jain  @ jainayus...@gmail.com or
Ashish Jain @ 26may.1...@gmail.com
<><><><><><><><><><><><><><><><><><><><><><>
HELP US GROW !!

We reach over 6,500 subscribers worldwide and receive many nice notes about the 
learning and support from the group. Our goal is to have 10,000 subscribers by 
the end of 2009. Let friends and co-workers know they can subscribe to group at 
http://groups.google.com/group/excel-macros/subscribe
-~----------~----~----~----~------~----~------~--~---

Reply via email to