hi,
in below code i am getting an error " compile error " else without if
![]()
Please Login or Register to view this content.
hi,
in below code i am getting an error " compile error " else without if
![]()
Please Login or Register to view this content.
Use Code-Tags for showing your code :
Please mark your question Solved if there has been offered a solution that works fine for you
If You like solutions provided by anyone, feel free to add reputation using STAR *
The red Else code block doesn't have an If statement. I don't know what you want, so I can't fix it.
![]()
Please Login or Register to view this content.
Surround your VBA code with CODE tags e.g.;
[CODE]your VBA code here[/CODE]
The # button in the forum editor will apply CODE tags around your selected text.
Hi,
The error means what it says- you have an Else statement but you have already closed all the If clauses. Properly indenting your code would make it more obvious to you.
Don
Please remember to mark your thread 'Solved' when appropriate.
hi,
actually i did
This else i was using with
then![]()
Please Login or Register to view this content.
else![]()
Please Login or Register to view this content.
thank you for the reply![]()
Please Login or Register to view this content.
No, you didn't - you think you did - what you think and what the code says are 2 different things.actually i did
If you took the time to correctly indent the code as AlphaFrog did, and xlNitWit mentioned, then errors like this are obvious. You can find free utilities online to indent.
Found the error
the red "end if" were in the wrong position
thank you all of you
![]()
Please Login or Register to view this content.
Therefore it is so important to indent your code so you can easily follow which If's and End If's belong together.
Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks