+ Reply to Thread
Results 1 to 6 of 6

Getting compile error 'loop without do'

  1. #1
    Forum Contributor
    Join Date
    06-29-2014
    Location
    India
    MS-Off Ver
    2010 Windows 10 64 bits
    Posts
    1,269

    Getting compile error 'loop without do'

    Hi friends,
    The code is working fine but I’m getting error ‘loop without do’. I want to insert this code in my original file in a macro. So I want to keep ‘lr’ and ‘loop’ in the code because it is in that code. It’s working fine with ‘with range ... end with’ but I don’t want to use it here.

    Please Login or Register  to view this content.
    Any help will be appreciated.

    Thanking you.
    Sincerely,

    mso3

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,953

    Re: Getting compile error 'loop without do'

    Might be working but it doesn't do anything as it stands. You're NOT looping and there ISN'T a DO to match the Loop. You've commented out the Range so the .FormulaR1C1 will fail to compile, as will the .Value.


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Contributor
    Join Date
    06-29-2014
    Location
    India
    MS-Off Ver
    2010 Windows 10 64 bits
    Posts
    1,269

    Re: Getting compile error 'loop without do'

    Thank you. Then what is your advice to use 'with range ... end with' to get output as value. Shall I use 'with range .. end with' or 'do .. loop'?
    Thank you.

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,953

    Re: Getting compile error 'loop without do'

    Assuming that B4:B50 is the range to receive the formula/value, uncomment the With / End With and remove the Loop keyword.


    Regards, TMS

  5. #5
    Forum Contributor
    Join Date
    06-29-2014
    Location
    India
    MS-Off Ver
    2010 Windows 10 64 bits
    Posts
    1,269

    Re: Getting compile error 'loop without do'

    Hi TMS,
    Thank you. Solved.

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,953

    Re: Getting compile error 'loop without do'

    You're welcome. Thanks for the rep.

+ 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. compile error: loop without do
    By phoenix073 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-15-2014, 03:44 PM
  2. [SOLVED] Compile error do without loop
    By mukeshbaviskar in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-29-2013, 08:34 PM
  3. Loop without Do compile error
    By Dulanic in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-09-2010, 12:12 PM
  4. Compile Error: Loop without Do
    By iii in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 07-24-2009, 06:41 PM
  5. Compile error: Loop WIthout Do
    By darin kelberlau in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-18-2005, 01:55 PM

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