+ Reply to Thread
Results 1 to 14 of 14

Next Without For (Error)

  1. #1
    Forum Contributor
    Join Date
    07-28-2018
    Location
    India
    MS-Off Ver
    2013
    Posts
    173

    Next Without For (Error)

    Hi Guys

    I tried to solve this end if without block if Issue but i was unable to solve it so plz help me in solving the same Sir
    Below is the code
    Thnx for ur Great Help


    Please Login or Register  to view this content.
    Last edited by Leonardo1234; 09-14-2022 at 02:26 AM.

  2. #2
    Forum Expert CheeseSandwich's Avatar
    Join Date
    12-22-2021
    Location
    Kent, England
    MS-Off Ver
    365 - 2402-17328.20068
    Posts
    1,361

    Re: end if without block if Issue

    The below part does not have a: Next bc6

    Please Login or Register  to view this content.
    If things don't change they stay the same

  3. #3
    Forum Contributor
    Join Date
    07-28-2018
    Location
    India
    MS-Off Ver
    2013
    Posts
    173

    Re: end if without block if Issue

    Yes it has bc6
    I am getting next without For Error Now Sir

  4. #4
    Forum Expert CheeseSandwich's Avatar
    Join Date
    12-22-2021
    Location
    Kent, England
    MS-Off Ver
    365 - 2402-17328.20068
    Posts
    1,361

    Re: end if without block if Issue

    That is what is causing the error, you have a for without a next...

    You can't have a for without a next or a next without a for.

  5. #5
    Forum Contributor
    Join Date
    07-28-2018
    Location
    India
    MS-Off Ver
    2013
    Posts
    173

    Re: end if without block if Issue

    So what should i do with this that i dont know Sir, So plz really really help me in solving this Sir

  6. #6
    Forum Expert CheeseSandwich's Avatar
    Join Date
    12-22-2021
    Location
    Kent, England
    MS-Off Ver
    365 - 2402-17328.20068
    Posts
    1,361

    Re: end if without block if Issue

    Replace the removing rows part with the below:
    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    07-28-2018
    Location
    India
    MS-Off Ver
    2013
    Posts
    173

    Re: end if without block if Issue

    Now i am getting block if without end if Sir

  8. #8
    Forum Expert CheeseSandwich's Avatar
    Join Date
    12-22-2021
    Location
    Kent, England
    MS-Off Ver
    365 - 2402-17328.20068
    Posts
    1,361

    Re: end if without block if Issue

    Go through your code and make sure that every 'If' has an 'End If' and Every 'For' has a 'Next'

  9. #9
    Forum Contributor
    Join Date
    07-28-2018
    Location
    India
    MS-Off Ver
    2013
    Posts
    173

    Re: end if without block if Issue

    Np sir i will do this part
    But i need one more help in solving Next without For error Sir plz

  10. #10
    Forum Contributor
    Join Date
    07-28-2018
    Location
    India
    MS-Off Ver
    2013
    Posts
    173

    Re: end if without block if Issue

    Please Login or Register  to view this content.
    Sir plz help in solving here also Sir for Next without For

  11. #11
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: Next Without For (Error)

    From the line of "Application.ScreenUpdating = False"
    count down:
    line 13 & 14 there are 2 "If" but one "End If"
    line 25 & 26 there are 2 "If" but one "End If"
    Next group of 2 If:
    PHP Code: 
    If wsh3.Range("C2").Value <> "" Or wsh3.Range("C2").Value "" Then
                  
    If VBA.Asc(UCase(wsh3.Range("C2"))) < 64 And VBA.Asc(UCase(wsh3.Range("C2"))) > 91 Then 
    have only one "end if"
    Quang PT

  12. #12
    Forum Contributor
    Join Date
    07-28-2018
    Location
    India
    MS-Off Ver
    2013
    Posts
    173

    Re: Next Without For (Error)

    Please Login or Register  to view this content.
    Sir Now i putted the end if & check all if conditions but i am gettingf error block if without end if

  13. #13
    Forum Expert CheeseSandwich's Avatar
    Join Date
    12-22-2021
    Location
    Kent, England
    MS-Off Ver
    365 - 2402-17328.20068
    Posts
    1,361

    Re: Next Without For (Error)

    Was missing an End If on the last section, if you indent your code within the 'If' 'Else' as below it will be easier to spot as you go.

    Please Login or Register  to view this content.

  14. #14
    Forum Contributor
    Join Date
    07-28-2018
    Location
    India
    MS-Off Ver
    2013
    Posts
    173

    Re: Next Without For (Error)

    Thnx Both of u in helping me in solving this problem
    It has been solved

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. End If Without Block If Issue
    By ffbaker81 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-20-2021, 02:46 PM
  2. [SOLVED] WorksheetFunction Using Date issue - (writers block)
    By PFDave in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-27-2017, 04:42 AM
  3. [SOLVED] Issue: SUCURI firewall block
    By Sam Capricci in forum Suggestions for Improvement
    Replies: 8
    Last Post: 03-29-2017, 12:36 PM
  4. Macro issue: Object variable or with block variable not set error
    By utgjmb1 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-29-2013, 06:07 AM
  5. Replies: 1
    Last Post: 07-24-2013, 02:45 PM
  6. Replies: 5
    Last Post: 10-09-2012, 10:44 AM
  7. Replies: 2
    Last Post: 06-22-2010, 07:55 AM

Tags for this Thread

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