Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,814
Default for...next funny behaviour

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,069
Default for...next funny behaviour

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,440
Default for...next funny behaviour

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,814
Default for...next funny behaviour

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,440
Default for...next funny behaviour

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Funny Reports Debra Excel Discussion (Misc queries) 1 December 19th 06 09:18 AM
<%<%<%<%HOW TO BE FUNNY!<%<%<%<% Expert Humor Charts and Charting in Excel 0 March 31st 06 08:11 AM
<%<%<%<%HOW TO BE FUNNY!<%<%<%<% Expert Humor Excel Worksheet Functions 0 March 31st 06 07:56 AM
<%<%<%<%HOW TO BE FUNNY!<%<%<%<% Expert Humor Excel Discussion (Misc queries) 0 March 31st 06 07:54 AM
Date looks funny! ajames Excel Discussion (Misc queries) 3 February 20th 06 02:01 PM


All times are GMT +1. The time now is 06:09 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"