Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Sub ChangeToNegative()
'Updateby20131113
Dim rng As Range
Dim WorkRng As Range
On Error Resume Next
xTitleId = "Hoc Excel Online"
Set WorkRng = Application.Selection
Set WorkRng = Application.InputBox("Range", xTitleId, WorkRng.Address, Type:=8)
Set WorkRng = WorkRng.SpecialCells(xlCellTypeConstants, xlNumbers)
For Each rng In WorkRng
xValue = rng.Value
If xValue > 0 Then
rng.Value = xValue * -1
End If
Next
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.