Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I have a for next loop in my vba code. First I comment out the for and the
next statements and the code compiles correctly. If I un-comment the for and leave the next commented out I get a "for without next" error. If I either un-comment the next and leave the for commented or un-comment both the for and the next I get a "next without for" error. |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Check your code for an If...End If construct that encompasses the Next
statement of your For...Next loop. Something like this: For x = 1 To 10 If Len(y)=0 Then 'do something Next x End If Hope this helps, Hutch "Steve" wrote: I have a for next loop in my vba code. First I comment out the for and the next statements and the code compiles correctly. If I un-comment the for and leave the next commented out I get a "for without next" error. If I either un-comment the next and leave the for commented or un-comment both the for and the next I get a "next without for" error. |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
How do you expect any of us to solve this without seeing your code?
-- Kind regards, Niek Otten Microsoft MVP - Excel "Steve" wrote in message ... |I have a for next loop in my vba code. First I comment out the for and the | next statements and the code compiles correctly. | | If I un-comment the for and leave the next commented out I get a "for | without next" error. | | If I either un-comment the next and leave the for commented or un-comment | both the for and the next I get a "next without for" error. | | |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
What a snot.
"Niek Otten" wrote: How do you expect any of us to solve this without seeing your code? -- Kind regards, Niek Otten Microsoft MVP - Excel "Steve" wrote in message ... |I have a for next loop in my vba code. First I comment out the for and the | next statements and the code compiles correctly. | | If I un-comment the for and leave the next commented out I get a "for | without next" error. | | If I either un-comment the next and leave the for commented or un-comment | both the for and the next I get a "next without for" error. | | |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I had no intention to offend you.
Of course we can start guessing. Surrounding For/Nexts? Overlooked or missing continuation symbol? Old Excel VBA in a localized language? etc. Why not give us just as much information as you gave to the compiler, which refused the code? -- Kind regards, Niek Otten Microsoft MVP - Excel "Steve" wrote in message ... | What a snot. | | "Niek Otten" wrote: | | How do you expect any of us to solve this without seeing your code? | | -- | Kind regards, | | Niek Otten | Microsoft MVP - Excel | | "Steve" wrote in message ... | |I have a for next loop in my vba code. First I comment out the for and the | | next statements and the code compiles correctly. | | | | If I un-comment the for and leave the next commented out I get a "for | | without next" error. | | | | If I either un-comment the next and leave the for commented or un-comment | | both the for and the next I get a "next without for" error. | | | | | | | |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Funny Reports | Excel Discussion (Misc queries) | |||
<%<%<%<%HOW TO BE FUNNY!<%<%<%<% | Charts and Charting in Excel | |||
<%<%<%<%HOW TO BE FUNNY!<%<%<%<% | Excel Worksheet Functions | |||
<%<%<%<%HOW TO BE FUNNY!<%<%<%<% | Excel Discussion (Misc queries) | |||
Date looks funny! | Excel Discussion (Misc queries) |