A alexm999 May 20, 2004 #1 Whats the VB code to make numbers negative? I need the following column negative: AP9:AP3
F Frank Kabel May 20, 2004 #2 Hi one way: try something like the following sub foo() dim rng as range dim cell as range set rng = activesheet.range("AP9:AP39) for each cell in rng if cell.value>0 then cell.value = -cell.value end if next end sub
Hi one way: try something like the following sub foo() dim rng as range dim cell as range set rng = activesheet.range("AP9:AP39) for each cell in rng if cell.value>0 then cell.value = -cell.value end if next end sub
C Chip Pearson May 20, 2004 #3 Try something like Dim Rng As Range For Each Rng In Range("AP9:AP39") Rng.Value = Rng.Value * -1 Next Rng -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com
Try something like Dim Rng As Range For Each Rng In Range("AP9:AP39") Rng.Value = Rng.Value * -1 Next Rng -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com