+ Reply to Thread
Results 1 to 8 of 8

Change values in rows based on cryteria in column A

  1. #1
    Registered User
    Join Date
    08-19-2014
    Location
    Bournemouth, England
    MS-Off Ver
    Office 365
    Posts
    24

    Change values in rows based on cryteria in column A

    Hi guys

    Could someone please help me with a macro which would change all values <-10 and <25 to 0 in columns B:BT, but only in those rows where column A contains a specific values like "Parameter1 " and "Parameter2"?

    Thank you in advance for your help.

    Kind regards

    Marek
    Last edited by Marq555; 02-02-2015 at 04:20 AM.

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Change values in rows based on cryteria in column A

    Why not simply <25?

    <-10 and <25 will be covered when we use <25 right?

    Or

    Am I missing your logic?


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,065

    Re: Change values in rows based on cryteria in column A

    Sixthsense's suggestion makes perfect (Sixth) sense :-)

    Following on from that does this work?

    Please Login or Register  to view this content.
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  4. #4
    Registered User
    Join Date
    08-19-2014
    Location
    Bournemouth, England
    MS-Off Ver
    Office 365
    Posts
    24

    Re: Change values in rows based on cryteria in column A

    Special-K, thank you for your reply. The provided by you code is missing "))" after <25. Also the Sixthsense's suggestion will not work as I am after the values which falls between -10 and +25.
    The data looks as shown on the screenshot below, "Parameter1" = Scheduled Deviation, "Parameter2" = Actual Run Time

    Capture.PNG


    Regards
    Last edited by Marq555; 02-02-2015 at 04:03 PM.

  5. #5
    Registered User
    Join Date
    02-05-2015
    Location
    Edmonton, Alberta
    MS-Off Ver
    2013
    Posts
    70

    Re: Change values in rows based on cryteria in column A

    If you want you could use a formula for this " =IF(AND(datasheet!C1>0-10,datasheet!C1<25)=TRUE,0,datasheet!C1) " That would require you to just create a second sheet that is an exact match and then paste that formula into the first cell of the table, then drag and copy that formula across the whole table

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,959

    Re: Change values in rows based on cryteria in column A

    Please upload a sample of your workbook, not a picture of your data. Pictures are pretty much impossible to edit, and no-one wants to re-type your data for you
    Also, not all members can upload picture files (Company firewalls and stuff)

    Your workbook should show a small desensitized example of the data you are working with and a manual mockup of the expected results.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  7. #7
    Registered User
    Join Date
    08-19-2014
    Location
    Bournemouth, England
    MS-Off Ver
    Office 365
    Posts
    24

    Re: Change values in rows based on cryteria in column A

    Hi daveisalvayshere, thank you for your suggestion. I have already done that but the final result is clunky as it takes a long time for the document to calculate cells.

    Regards

  8. #8
    Registered User
    Join Date
    02-05-2015
    Location
    Edmonton, Alberta
    MS-Off Ver
    2013
    Posts
    70

    Re: Change values in rows based on cryteria in column A

    Ok no worries, As a project manager i never suggest inputting the data incorrectly or at least have the back up for it....."Was cell B3 a 15 or was it always 0?" its always good to have the data input sheet and an output format if you get what i mean.

+ 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: 0
    Last Post: 09-28-2012, 07:55 AM
  2. Replies: 4
    Last Post: 07-30-2012, 04:21 PM
  3. Instantly change column values after copy/insert rows based on input - Selection parameter
    By BuzzOffSweetheart in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-20-2012, 09:47 AM
  4. Insert New Rows when Column Values Change
    By mridzuani in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 02-08-2009, 10:36 AM
  5. Insert 2 New Rows when Column A Values Change
    By R_S_6 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-05-2009, 03:25 AM

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