+ Reply to Thread
Results 1 to 5 of 5

Infinite Loop Error

  1. #1
    Registered User
    Join Date
    09-17-2016
    Location
    Adelaide, Australia
    MS-Off Ver
    2013
    Posts
    6

    Infinite Loop Error

    Okay so basically I want to print each individual iteration of this loop (I will be adding in way more for loops when I get this working) to print the value of a certain cell as well as the values of my variables which are changing for each iteration. I therefore need to set up a counter which I can use as the row for each iteration and I am having an issue with it as it is going infinite. I don't have any experience with VBA but this would work in other languages I briefly used at uni unless I am mistaken. So basically the output of this is value a 1, value b is 1 and the value being printed into to column 52 is in tern the same and this is printing infinitely downwards from row 75 (which is where count starts). I am hoping my mistake is obvious, thanks for helping!

    Please Login or Register  to view this content.
    Last edited by ShennyP; 09-28-2016 at 08:34 AM.

  2. #2
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: Infinite Loop Error

    You need to change the declaration for a & b.

    More details when this thread complies with the forum rules - in particular #3: Code tags

  3. #3
    Registered User
    Join Date
    09-17-2016
    Location
    Adelaide, Australia
    MS-Off Ver
    2013
    Posts
    6

    Re: Infinite Loop Error

    Quote Originally Posted by cytop View Post
    You need to change the declaration for a & b.

    More details when this thread complies with the forum rules - in particular #3: Code tags
    Sorry fixed it up.

    I thought it was an issue with the count, but like I said I have little experience in vba

  4. #4
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Infinite Loop Error

    You need to declare A and B as Double, because the .5 increment doesn't work with data type Long.

    Your use of the count variable looks like the way to go. Although if there are potentially lots of rows involved, you would want to type that as Long rather than Integer.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  5. #5
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: Infinite Loop Error

    Deleted. Answered while composing message

+ 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. Infinite Loop
    By amphinomos in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-20-2015, 07:56 AM
  2. Why is my loop infinite, and how can I fix it?
    By Mrowe in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 07-13-2012, 02:48 PM
  3. Infinite Loop
    By randell.graybill in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-12-2010, 10:44 PM
  4. Infinite Loop
    By phong919 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 01-22-2010, 04:56 PM
  5. Error Handling - Infinite loop
    By coder_arun in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-03-2006, 08:38 AM
  6. [SOLVED] For Next Infinite Loop
    By Naji in forum Excel General
    Replies: 5
    Last Post: 01-13-2006, 03:00 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