Negative Numbers


A

alexm999

Whats the VB code to make numbers negative?
I need the following column negative:
AP9:AP3
 
Ad

Advertisements

F

Frank Kabel

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

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
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Negative numbers 7
negative numbers 2
Negative number 13
negative number 3
negative numbers 4
negative number 2
Negative Numbers count 3
Invert Negative number? 5

Top