+ Reply to Thread
Results 1 to 10 of 10

If Criteria Met Change Positive values to Negative

  1. #1
    Forum Contributor
    Join Date
    08-29-2012
    Location
    Hyderbad
    MS-Off Ver
    Excel 2003
    Posts
    122

    If Criteria Met Change Positive values to Negative

    Please Login or Register  to view this content.
    Error :
    Cells("d" & x & ":h" & x).Value = Cells("d" & x & ":h" & x).Value * -1

    Need to change above Cells("d" & x & ":h" & x) into negative values if above condition met.

    Capture.JPG
    Last edited by jagadeesh.rt; 11-07-2019 at 12:19 PM. Reason: Attachement

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

    Re: If Criteria Met Change Positive values to Negative

    I'm just doing this from the cuff, but I assume you need to multiply each cell by -1

    cells should be range

    Please Login or Register  to view this content.
    Last edited by davesexcel; 11-07-2019 at 12:26 PM.

  3. #3
    Forum Contributor
    Join Date
    08-29-2012
    Location
    Hyderbad
    MS-Off Ver
    Excel 2003
    Posts
    122

    Re: If Criteria Met Change Positive values to Negative

    Please Login or Register  to view this content.
    Hi,
    it's not working. any changes to be done for the above code ....!

  4. #4
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,410

    Re: If Criteria Met Change Positive values to Negative

    Assuming no blank cells within your data in Columns D:H, then I think this non-looping macro should also work...
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    08-29-2012
    Location
    Hyderbad
    MS-Off Ver
    Excel 2003
    Posts
    122

    Re: If Criteria Met Change Positive values to Negative

    Hi Rick,

    Here I need loop too, because having multiple criteria's to be met.

  6. #6
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,410

    Re: If Criteria Met Change Positive values to Negative

    Quote Originally Posted by jagadeesh.rt View Post
    Here I need loop too, because having multiple criteria's to be met.
    I do not remember you saying that in your original message. What are your "multiple criteria"?

    Something for you to consider for future postings...

    For future questions you may ask, please do not simplify your question for us... doing so will get you a great answer to a question you do not actually have and which you do not actually care about AND it will almost always lead to you coming back for help when the solution we give you for the simplified question cannot be applied to your actual data and its layout. One thing you must keep in mind when you ask a question in a forum... the people you are asking to help you know absolutely nothing about your data, absolutely nothing about how it is laid out in the workbook, absolutely nothing about what you want done with it and absolutely nothing about how whatever it is you want done is to be presented back to you as a result... you must be very specific about describing each of these areas, in detail, and you should not assume that we will be able to "figure it out" on our own. Remember, you are asking us for help... so help us to be able to help you by providing the information we need to do so, even if that information seems "obvious" to you (remember, it is only obvious to you because of your familiarity with your data).

  7. #7
    Forum Contributor
    Join Date
    08-29-2012
    Location
    Hyderbad
    MS-Off Ver
    Excel 2003
    Posts
    122

    Re: If Criteria Met Change Positive values to Negative

    If Cells(x, 2).Value = "COLUMN B" Then
    column d and column e values to be converted into negative values.

    As the column b values not restricted depends on my data columns will be
    increased, so using loop here. Tried to upload test excel, getting error on uploading.

    column B column d column e

    ABC 309,830,931.00 240,719,574.00
    Jrt 2,717,411.55 3,660,203.15
    Mkt 3,660,203.15 3,660,203.15
    ABC 2,717,411.55 309,830,931.00
    Srt 240,719,574.00 2,717,411.55


    Capture1.JPG
    Last edited by jagadeesh.rt; 11-07-2019 at 03:34 PM. Reason: image upload

  8. #8
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,410

    Re: If Criteria Met Change Positive values to Negative

    Quote Originally Posted by jagadeesh.rt View Post
    Tried to upload test excel, getting error on uploading.
    See the yellow banner at the top of this webpage.

  9. #9
    Valued Forum Contributor
    Join Date
    06-27-2010
    Location
    sYRIA
    MS-Off Ver
    Excel 2013
    Posts
    669

    Re: If Criteria Met Change Positive values to Negative

    Try
    Please Login or Register  to view this content.

  10. #10
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,410

    Re: If Criteria Met Change Positive values to Negative

    Quote Originally Posted by jagadeesh.rt View Post
    If Cells(x, 2).Value = "COLUMN B" Then
    column d and column e values to be converted into negative values.
    This is not clear to me. What your code line is doing is checking if the values in Column B equal the text "COLUMN B". Please clarify.



    Quote Originally Posted by jagadeesh.rt View Post
    As the column b values not restricted depends on my data columns will be
    increased, so using loop here.
    I am still confused. What are you checking and why do you think you need to do a loop?



    Quote Originally Posted by jagadeesh.rt View Post
    Tried to upload test excel, getting error on uploading.
    To repeat what I wrote in Message #8... see the yellow banner at the top of this webpage.

+ 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. To change the negative value into positive values
    By dggeelong in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-12-2014, 07:19 AM
  2. Find where values change from positive to negative
    By jevans30253 in forum Excel General
    Replies: 2
    Last Post: 09-28-2010, 10:06 PM
  3. Change values from Positive to negative etc
    By GBR2L in forum Excel General
    Replies: 6
    Last Post: 09-09-2010, 09:51 AM
  4. Replies: 4
    Last Post: 09-26-2005, 06:05 PM
  5. [SOLVED] How to change negative to positive
    By Niek Otten in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-06-2005, 04:05 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