I trying to turn a list of negative numbers positive. Can someone please let me alter this code to do that. I guess i want the absolute value?
Please Login or Register to view this content.
I trying to turn a list of negative numbers positive. Can someone please let me alter this code to do that. I guess i want the absolute value?
Please Login or Register to view this content.
The simplest solution is to multiply the selected range by -1. Let's say you have put -1 in I6
Please Login or Register to view this content.
Or do you want like
?Please Login or Register to view this content.
is there a way to do it within the line of code to do it? Im afraid that is not working how i had hoped.
Unless I am missing something, I do not think so. You have negative values and want to convert them into +ve, you can use a loop and change every single value.
Last edited by AB33; 10-12-2016 at 03:52 PM.
You only show a couple of lines of code without any other context. One thought that kind of, sort of is within the line of code is to have a helper column in the spreadsheet. I cannot tell If you are talking about the values being pasted into column K in the first line or the values being copied from AK in the second line. In either case, if the signed data is in K or AK, then a helper column (say in L or AL) with =ABS(K53) or =ABS(AK2) in it would calculate the unsigned values as fast as Excel could perform the calculate event (or as soon as your code executes a .calculate method, if you have calculation set to manual). Of course, that means that you can no longer look in K or AK for the unsigned values -- you have to look in L or AL, but that should be a straightforward adjustment.
Originally Posted by shg
Ok- as always you guys are spectacular with all of your help and I so appreciate you all.
What I ended up doing was processing the report as I normally do but then at the end I ran a new macro that basically turned the area i needed to into a ABS and pasted it right back. Problem solved albeit ugly.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks