+ Reply to Thread
Results 1 to 3 of 3

loops

  1. #1
    Forum Contributor
    Join Date
    03-05-2015
    Location
    norwich
    MS-Off Ver
    365
    Posts
    107

    loops

    Hi,

    I was wondering if you could help me. I have a basic loop

    Please Login or Register  to view this content.
    The sequence of values which it's looping through go like 1,2,2,2,3,3,4,1,1,1,2,3,3,3.

    The aim of this section of code is to blank out values duplicates and convert adjacent non-duplicates to 1 so it will go 1,1,"","",1,"",1,1,"","",1,1,"","". However, the loop fails (probably really obviously to you) because once a value is changed in the row above then the >than conditions are changed, I guess like a circular reference. Is it possible to bypass this? by "storing" the values and only changing them after the loop is finished?

    Or do I need to copy the values into a different column, do the loop and then bring them back?

    Sorry if this doesn't sound clear

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,524

    Re: loops

    Would the algorithm be, if the cell= the cell above, then blank, else 1

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,379

    Re: loops

    Please take a moment to re-read forum rule #1 and then amend your thread title to something that better explains your problem. Changing your thread title is not optional, which means you must change it. Thanks!

    • Use concise, accurate thread titles.
    • Your post title should describe your problem, not your anticipated solution.
    • Use terms appropriate to a Google search - poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice tell us nothing.
    • Responding to a request to change your thread title by doing so is mandatory.

    To change a title go to your first post, click EDIT then Go Advanced and change your title.

    No help to be offered, please, until the OP complies with this request.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

+ 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. Loops within loops looping
    By Memphismark in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-15-2017, 12:21 PM
  2. [SOLVED] Sum of all Loops - VBA
    By Blackhawks in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-06-2016, 11:35 AM
  3. [SOLVED] For next loops
    By Boblincs in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-06-2013, 01:49 PM
  4. Loops within loops?
    By Coeus in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 07-21-2013, 09:55 AM
  5. Using loops in VBA
    By reefswaggie in forum Excel - New Users/Basics
    Replies: 7
    Last Post: 05-11-2012, 02:28 PM
  6. Do Loops
    By kathhying in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-08-2011, 09:34 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