+ Reply to Thread
Results 1 to 4 of 4

Macro that Adds 1 to field until two conditions are met.

  1. #1
    Registered User
    Join Date
    01-20-2022
    Location
    Providence, Rhode Island
    MS-Off Ver
    O365
    Posts
    2

    Cool Macro that Adds 1 to field until two conditions are met.

    Hello,

    I need help creating a macro on the sample file that i've attached. I would like the macro to check if Column E < .75 and Column I > .85, if so then do nothing. If not, then keep adding 1 to Column C until Column E < .75 and Column I > .85.

    I'm very new to macros and was trying to use the Do Until loops but couldn't get the hang of it. If it's helpful there will always be 48 rows so one condition could be Do until i = 48 but then i'm not sure what to do with the other variable or if it's nested or not.

    Any help would be appreciated!

    Thanks,
    Zach
    Attached Files Attached Files

  2. #2
    Forum Expert nankw83's Avatar
    Join Date
    08-31-2015
    Location
    Kuwait
    MS-Off Ver
    365
    Posts
    1,712

    Re: Macro that Adds 1 to field until two conditions are met.

    Hi Zach & welcome to the forum

    Try below code ...
    Please Login or Register  to view this content.
    If I was able to help, you can thank me by clicking the * Add Reputation under my user name

  3. #3
    Registered User
    Join Date
    01-20-2022
    Location
    Providence, Rhode Island
    MS-Off Ver
    O365
    Posts
    2

    Re: Macro that Adds 1 to field until two conditions are met.

    Thank you! I made some adjustments for my purposes and that seemed to do the trick.

    Please Login or Register  to view this content.

  4. #4
    Forum Expert nankw83's Avatar
    Join Date
    08-31-2015
    Location
    Kuwait
    MS-Off Ver
    365
    Posts
    1,712

    Re: Macro that Adds 1 to field until two conditions are met.

    Glad to help

    Perhaps you could shorten your code like below ...
    Please Login or Register  to view this content.

+ 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. Replies: 10
    Last Post: 08-21-2017, 12:19 PM
  2. [SOLVED] How to: Create button that adds +1 to A1 field each time it's clicked.
    By 100n3y in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-30-2015, 09:28 AM
  3. Replies: 0
    Last Post: 04-22-2013, 12:13 PM
  4. Replies: 19
    Last Post: 03-04-2013, 01:16 PM
  5. Replies: 0
    Last Post: 12-22-2011, 03:42 PM
  6. Replies: 2
    Last Post: 01-06-2010, 05:51 AM
  7. Macro that adds records
    By john in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-19-2006, 11:00 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