Error :Please Login or Register to view this content.
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
Error :Please Login or Register to view this content.
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
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.
Hi,Please Login or Register to view this content.
it's not working. any changes to be done for the above code ....!
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.
Hi Rick,
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).
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
Try
Please Login or Register to view this content.
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.
I am still confused. What are you checking and why do you think you need to do a loop?
To repeat what I wrote in Message #8... see the yellow banner at the top of this webpage.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks