Transform positive numbers into negative

R

Robert

Hi All,

Does anyone know which statement to use for changing a range of
positive numbers (say range("A1:A10") into negative?

Thanks again!

Rgds,
Robert
 
R

RichardSchollar

Hi Robert

Maybe:

Set rng = Range("A1:A10")
rng.Value = Evaluate(rng.Address & "*-1")

Hope this helps!

Richard
 
D

Don Guillett

try
Sub changepostoneg()
For Each c In Range("a1:a10")
If c > 0 Then c.Value = -c
Next
End Sub
 
P

Peter T

One more - manually (or record macro)

copy a cell containing -1
select cells to be negated
PasteSpecial > multiply

Regards,
Peter T
 
G

Guest

Sub PositivetoNegative()
Range("A1").Activate
Do
If Left(Activecell,1) <> "-" then
Activecell = Activecell*-1
End If
Activecell.Offset(1,0).Activate
Loop until Activecell = ""
End Sub
 

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

Top