+ Reply to Thread
Results 1 to 7 of 7

Loop Through Range to change CheckBoxes Value in A Conditional Using Variables

  1. #1
    Registered User
    Join Date
    04-24-2019
    Location
    Bogota,Colombia
    MS-Off Ver
    2013
    Posts
    42

    Loop Through Range to change CheckBoxes Value in A Conditional Using Variables

    Hi everyone,

    I have been trying to loop through a range of cells and if they have a value different to blank, they should trigger the change of their respective row in another column that contains checkboxes to set their corresponding row value to True. I would require this to be done through the Worksheet Change Event so that every time there is new data input, the formula changes value and then the code gets executed. I have tried everything and now Excel just keeps on restarting every time if I try something new so any help would be greatly appreciated!

    I have attached a sample spreadsheet to show what I mean.
    Last edited by realbestpete; 01-31-2021 at 03:23 PM. Reason: Solved

  2. #2
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: Loop Through Range to change CheckBoxes Value in A Conditional Using Variables

    Try

    Please Login or Register  to view this content.
    Last edited by maniacb; 01-31-2021 at 08:28 AM. Reason: Corrections to response

  3. #3
    Registered User
    Join Date
    04-24-2019
    Location
    Bogota,Colombia
    MS-Off Ver
    2013
    Posts
    42

    Re: Loop Through Range to change CheckBoxes Value in A Conditional Using Variables

    Thank you very much maniacb, I tried your code and it works just fine!! As I think coding is important as part of a learning process, I would like to leave the Thread open for a couple of days if that is not against the rules just to see if anyone comes up with a different approach, which would be interesting as I said for learning! Cheers!!

  4. #4
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,080

    Re: Loop Through Range to change CheckBoxes Value in A Conditional Using Variables

    Another way, using column to define the last row
    Please Login or Register  to view this content.
    This may need a slight tweak to work with Xl 2013

  5. #5
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,080

    Re: Loop Through Range to change CheckBoxes Value in A Conditional Using Variables

    Just realised that col E is formulae, this will run when you change a value in col C
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    04-24-2019
    Location
    Bogota,Colombia
    MS-Off Ver
    2013
    Posts
    42

    Re: Loop Through Range to change CheckBoxes Value in A Conditional Using Variables

    Unbelievable, it also worked and it's a third shorter! Thanks mate!

  7. #7
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,080

    Re: Loop Through Range to change CheckBoxes Value in A Conditional Using Variables

    Glad to help & thanks for the feedback.

+ 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. Change variables on every second loop
    By nigelog in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-28-2018, 11:02 AM
  2. Loop Through List to Change Variables
    By racer25 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-07-2016, 02:48 PM
  3. Nested For Each loop for 2 range variables
    By artur.serra in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-03-2013, 10:34 AM
  4. Replies: 4
    Last Post: 04-28-2013, 12:47 AM
  5. [SOLVED] Applying Conditional Formatting to a Range in VBA (range is set by variables)
    By JungleJme in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-12-2013, 08:32 AM
  6. change the range on autofill to use defined variables
    By clemsoncooz in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-02-2012, 10:43 AM
  7. Select Range using variables-used a For Next Loop
    By adiman84 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-06-2008, 08:15 PM

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