Hi,
I have this code as example, but when I try to run it, it says:
"Next without For".
Am I missing anything, or doing anything not good?
Any help?Please Login or Register to view this content.
Thanks.
Hi,
I have this code as example, but when I try to run it, it says:
"Next without For".
Am I missing anything, or doing anything not good?
Any help?Please Login or Register to view this content.
Thanks.
I believe that your Next j statement needs to go after your End If statement or before your If statement. Can't really tell because I don't know what your intentions for work flow are.
Alan עַם יִשְׂרָאֵל חַי
Change an Ugly Report with Power Query
Database Normalization
Complete Guide to Power Query
Man's Mind Stretched to New Dimensions Never Returns to Its Original Form
Hi calvinle,
You had the 'If Loop' wrapped around the 'Next j'.
Your code should look something like this:
LewisPlease Login or Register to view this content.
It seems that your IF statement starts within For loop but Elseif and End If are out side the For loop (i.e. after Next j).
Regards
sktneer
Treat people the way you want to be treated. Talk to people the way you want to be talked to.
Respect is earned NOT given.
Hi,
Yes your use of the If..End If is wrong. You can't start an IF block i side a loop and End it outside the loop. In general you must have
Please Login or Register to view this content.
Richard Buttrey
RIP - d. 06/10/2022
If any of the responses have helped then please consider rating them by clicking the small star icon below the post.
Thanks everyone for your response.. The reason I add the "j" is to not have to repeat the same macro again, so I called it "j", for the macro to redo this whole process a second time:
Instead of having to do this:
I wanted to repeat this process 2 times without having to copy and paste this code 2 times, so I add a "j", and have to next j to go back to redo this code once again.Please Login or Register to view this content.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks