+ Reply to Thread
Results 1 to 10 of 10

invalid next control variable reference for looping

  1. #1
    Registered User
    Join Date
    05-29-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    5

    Unhappy invalid next control variable reference for looping

    I get "invalid next control variable reference", can anyone tell me what's wrong with my script?

    Please Login or Register  to view this content.

  2. #2
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: invalid next control variable reference for looping

    You are missing a
    Please Login or Register  to view this content.
    line before the
    Please Login or Register  to view this content.
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  3. #3
    Registered User
    Join Date
    05-29-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    5

    Unhappy Re: invalid next control variable reference for looping

    Come out with new error "Next without For"

    Next without For.JPG

    Please Login or Register  to view this content.

  4. #4
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: invalid next control variable reference for looping

    You removed the For i loop!

  5. #5
    Registered User
    Join Date
    05-29-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    5

    Thumbs up Re: invalid next control variable reference for looping

    Gosh! Sorry for my noobness

    Btw, when i try to insert 1 more cell to change the value this error pops out.

    Any idea? Thanks man!

    Wrong Number.JPG

    Please Login or Register  to view this content.

  6. #6
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: invalid next control variable reference for looping

    what range are you trying to process? Range("f15", "c6") refers to all the cells from c6 down and across to f15 not just those two cells
    Perhaps you want Range("d15,f15,c6") to just process three cells?

  7. #7
    Registered User
    Join Date
    05-29-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    5

    Red face Re: invalid next control variable reference for looping

    Yup, i only want those 3 cell value to be change.
    Currently i put it this way, no error so far.
    What's your opinions?

    Please Login or Register  to view this content.

  8. #8
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: invalid next control variable reference for looping

    That includes E15

  9. #9
    Registered User
    Join Date
    05-29-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: invalid next control variable reference for looping

    oic, then it's ok coz no value will be added in E15

    Btw, is there any way to reflect a value from A1 to B1 with additional symbols?

    Example:

    A1 = 1100

    After reflect to B1

    B1 = *1100*

    Thanks in advance

  10. #10
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: invalid next control variable reference for looping

    Yes you can concatenate those symbols with the value using the & operator or you could simply use a custom number format on the cell

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1