PDA

View Full Version : Solved: How do you convert negative number to positive?



genracela
07-08-2010, 11:21 PM
My columns F:S has negative numbers, I want to convert it into positive number. How will I do it in such a way that I don't have to manually type -() in every cell?

Thanks!

mdmackillop
07-09-2010, 12:29 AM
Your question does not match the title, but to answer the question

Dim cel As Range
For Each cel In Columns("F:S").SpecialCells(xlCellTypeConstants, 1)
cel.Value = Abs(cel)
Next


Edit: Are your negatives the result of calculated cells?

Bob Phillips
07-09-2010, 12:30 AM
Find a free cell and type -1 in it. Copy that cell.

Then select all of the numbers that you want to convert, goto Edit>PasteSpecial... and in the Operation section select the Multiply button.

OK out, then clear that cell with the -1.

genracela
07-09-2010, 12:34 AM
Ooopppsss, missed that! Sorry!

But anyway, Hi again Mdmckillop!

Thanks for the code!!!

and xld, thanks again for the 1 millionth help you gave me! I'll try that, but mdmckillop's code fits lazy people(like me) better!:rotlaugh:

mwah! mwah! mwah!