close


quot;Frank Kabelquot; wrote:

gt; Hi
gt; - put -1 in an empty cell
gt; - copy this cell
gt; - select your negative numbers
gt; - use 'Edit - Paste Special - Multiply'
gt;
gt; --
gt; Regards
gt; Frank Kabel
gt; Frankfurt, Germany
gt;
gt; quot;fgiordquot; gt; schrieb im Newsbeitrag
gt; ...
gt; gt; How can I change a negative number to positive number
gt;

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 quot;(-)quot; and name quot;Negate Selectionquot;.
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 lt;= h
While wctr lt;= w
selectionRange(hctr, wctr) = selectionRange(hctr, wctr) * -1
wctr = wctr 1
Wend
wctr = 1
hctr = hctr 1
Wend

Selection.Value = selectionRange

End Subgt; quot;Frank Kabelquot; wrote

There's a blast from the past. Where did this thread come from? Even in OE
quot;Show all messagesquot; it is on its own

--

Sandy
In Perth, the ancient capital of Scotland

with @tiscali.co.ukquot;Mike Caseyquot; lt;Mike gt; wrote in message
...
gt;
gt;
gt; quot;Frank Kabelquot; wrote:
gt;
gt;gt; Hi
gt;gt; - put -1 in an empty cell
gt;gt; - copy this cell
gt;gt; - select your negative numbers
gt;gt; - use 'Edit - Paste Special - Multiply'
gt;gt;
gt;gt; --
gt;gt; Regards
gt;gt; Frank Kabel
gt;gt; Frankfurt, Germany
gt;gt;
gt;gt; quot;fgiordquot; gt; schrieb im Newsbeitrag
gt;gt; ...
gt;gt; gt; How can I change a negative number to positive number
gt;gt;
gt;
gt; Copy and paste the following macro into your personal macro workbook. All
gt; you have to do is select what you want to negate and run the macro. I
gt; assigned a custom button with the picture quot;(-)quot; and name quot;Negate
gt; Selectionquot;.
gt; Take notes Microsoft.
gt;
gt; 'Copy Below He
gt;
gt; Sub Negate()
gt; '
gt; ' Negate Macro
gt; ' Macro recorded 4/25/2006 by mcasey
gt;
gt; Dim h, w, hctr, wctr As Integer
gt; Dim selectionRange() As Variant
gt;
gt; h = Selection.Rows.Count
gt; w = Selection.Columns.Count
gt; selectionRange = Selection.Value
gt; hctr = 1
gt; wctr = 1
gt;
gt; While hctr lt;= h
gt; While wctr lt;= w
gt; selectionRange(hctr, wctr) = selectionRange(hctr, wctr) * -1
gt; wctr = wctr 1
gt; Wend
gt; wctr = 1
gt; hctr = hctr 1
gt; Wend
gt;
gt; Selection.Value = selectionRange
gt;
gt; End Sub
gt;
I was looking for an easy way to negate numbers and this was the first thread
on the list when I searched for quot;negativequot; so once I made my own method I
thought I'd share it with anyone else searching.

-Mike

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()