Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Mike Casey
 
Posts: n/a
Default negative number to positive number



"Frank Kabel" wrote:

Hi
- put -1 in an empty cell
- copy this cell
- select your negative numbers
- use 'Edit - Paste Special - Multiply'

--
Regards
Frank Kabel
Frankfurt, Germany

"fgiord" schrieb im Newsbeitrag
...
How can I change a negative number to positive number



Copy and paste the following macro into your personal macro workbook. All
you have to do is select what you want to negate and run the macro. I
assigned a custom button with the picture "(-)" and name "Negate Selection".
Take notes Microsoft.

'Copy Below He

Sub Negate()
'
' Negate Macro
' Macro recorded 4/25/2006 by mcasey

Dim h, w, hctr, wctr As Integer
Dim selectionRange() As Variant

h = Selection.Rows.Count
w = Selection.Columns.Count
selectionRange = Selection.Value
hctr = 1
wctr = 1

While hctr <= h
While wctr <= w
selectionRange(hctr, wctr) = selectionRange(hctr, wctr) * -1
wctr = wctr + 1
Wend
wctr = 1
hctr = hctr + 1
Wend

Selection.Value = selectionRange

End Sub

  #3   Report Post  
Posted to microsoft.public.excel.misc
Mike Casey
 
Posts: n/a
Default negative number to positive number

I was looking for an easy way to negate numbers and this was the first thread
on the list when I searched for "negative" so once I made my own method I
thought I'd share it with anyone else searching.

-Mike
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
MROUND on a negative number. Big Rick Excel Discussion (Misc queries) 6 December 29th 05 03:45 PM
Change Number to a negative in VBA Noemi Excel Discussion (Misc queries) 2 November 22nd 05 11:58 AM
I Need a formula to evaluate a cell with + or - values Bob in Oklahoma Excel Worksheet Functions 6 October 31st 05 02:41 PM
How do I set a rule to add a number, but only if it is positive? PaRtaP Excel Worksheet Functions 6 October 31st 05 12:05 AM
how do i subtract a negative number anndee Excel Worksheet Functions 2 June 11th 05 08:14 PM


All times are GMT +1. The time now is 01:20 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"