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!
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!
Last edited by mdmackillop; 07-09-2010 at 12:47 AM. Reason: Title corrected
Your question does not match the title, but to answer the question
[vba]Dim cel As Range
For Each cel In Columns("F:S").SpecialCells(xlCellTypeConstants, 1)
cel.Value = Abs(cel)
Next
[/vba]
Edit: Are your negatives the result of calculated cells?
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
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.
____________________________________________
Nihil simul inventum est et perfectum
Abusus non tollit usum
Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
James Thurber
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!
mwah! mwah! mwah!