Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 2
Default Negative column

Hi, I would like to be able to enter a positive number in a cell and Excell
automaticaly make it a negitive. I sure there is an easy answer to this, but
I can't figure it out. Any ideas?

Mark
  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 1,726
Default Negative column

Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "H1:H10" '<== change to suit

On Error GoTo ws_exit
Application.EnableEvents = False

If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
If IsNumeric(.Value) Then
If .Value < 0 Then
.Value = .Value * -1
End If
End If
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click


--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"haigh" wrote in message
...
Hi, I would like to be able to enter a positive number in a cell and
Excell
automaticaly make it a negitive. I sure there is an easy answer to this,
but
I can't figure it out. Any ideas?

Mark



  #3   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 2,574
Default Negative column

You can also enter the list of positive numbers, and, upon completion, enter
-1 somewhere on the worksheet, copy it, select the column of numbers you
entered, select paste special, multiply. This will convert all the positive
numbers to negative.
--
Brevity is the soul of wit.


"Bob Phillips" wrote:

Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "H1:H10" '<== change to suit

On Error GoTo ws_exit
Application.EnableEvents = False

If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
If IsNumeric(.Value) Then
If .Value < 0 Then
.Value = .Value * -1
End If
End If
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click


--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"haigh" wrote in message
...
Hi, I would like to be able to enter a positive number in a cell and
Excell
automaticaly make it a negitive. I sure there is an easy answer to this,
but
I can't figure it out. Any ideas?

Mark




  #4   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 16
Default Negative column

This could be an easy answer, copy the data, in a blank section Editpaste
specialSubtract

"haigh" wrote:

Hi, I would like to be able to enter a positive number in a cell and Excell
automaticaly make it a negitive. I sure there is an easy answer to this, but
I can't figure it out. Any ideas?

Mark

  #5   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 1,726
Default Negative column

It will also convert negative numbers to positive!

--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"Dave F" wrote in message
...
You can also enter the list of positive numbers, and, upon completion,
enter
-1 somewhere on the worksheet, copy it, select the column of numbers you
entered, select paste special, multiply. This will convert all the
positive
numbers to negative.
--
Brevity is the soul of wit.


"Bob Phillips" wrote:

Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "H1:H10" '<== change to suit

On Error GoTo ws_exit
Application.EnableEvents = False

If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
If IsNumeric(.Value) Then
If .Value < 0 Then
.Value = .Value * -1
End If
End If
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click


--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"haigh" wrote in message
...
Hi, I would like to be able to enter a positive number in a cell and
Excell
automaticaly make it a negitive. I sure there is an easy answer to
this,
but
I can't figure it out. Any ideas?

Mark








  #6   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 16
Default Negative column

If Dave F answer almost worked maybe something similar to
=IF(A1<0,A1,A1*"-1")

"Dave F" wrote:

You can also enter the list of positive numbers, and, upon completion, enter
-1 somewhere on the worksheet, copy it, select the column of numbers you
entered, select paste special, multiply. This will convert all the positive
numbers to negative.
--
Brevity is the soul of wit.


"Bob Phillips" wrote:

Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "H1:H10" '<== change to suit

On Error GoTo ws_exit
Application.EnableEvents = False

If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
If IsNumeric(.Value) Then
If .Value < 0 Then
.Value = .Value * -1
End If
End If
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click


--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"haigh" wrote in message
...
Hi, I would like to be able to enter a positive number in a cell and
Excell
automaticaly make it a negitive. I sure there is an easy answer to this,
but
I can't figure it out. Any ideas?

Mark




  #7   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 1,726
Default Negative column

or just

=ABS(A1)

--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"Spidey" wrote in message
...
If Dave F answer almost worked maybe something similar to
=IF(A1<0,A1,A1*"-1")

"Dave F" wrote:

You can also enter the list of positive numbers, and, upon completion,
enter
-1 somewhere on the worksheet, copy it, select the column of numbers you
entered, select paste special, multiply. This will convert all the
positive
numbers to negative.
--
Brevity is the soul of wit.


"Bob Phillips" wrote:

Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "H1:H10" '<== change to suit

On Error GoTo ws_exit
Application.EnableEvents = False

If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
If IsNumeric(.Value) Then
If .Value < 0 Then
.Value = .Value * -1
End If
End If
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click


--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"haigh" wrote in message
...
Hi, I would like to be able to enter a positive number in a cell and
Excell
automaticaly make it a negitive. I sure there is an easy answer to
this,
but
I can't figure it out. Any ideas?

Mark





  #8   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 2
Default Negative column

Thanks all. Have got it working now. Many thanks.

~Mark

"Spidey" wrote:

This could be an easy answer, copy the data, in a blank section Editpaste
specialSubtract

"haigh" wrote:

Hi, I would like to be able to enter a positive number in a cell and Excell
automaticaly make it a negitive. I sure there is an easy answer to this, but
I can't figure it out. Any ideas?

Mark

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
Return SEARCHED Column Number of Numeric Label and Value Sam via OfficeKB.com Excel Worksheet Functions 23 January 30th 06 06:16 PM
IF/AND/OR/DATEIF Issue...sorry...long post... EDSTAFF Excel Worksheet Functions 1 November 10th 05 12:28 AM
creating a bar graph Johnfli Excel Discussion (Misc queries) 0 October 26th 05 08:16 PM
match and count words David Excel Worksheet Functions 5 July 4th 05 02:24 AM
Return Count for LAST NonBlank Cell in each Row Sam via OfficeKB.com Excel Worksheet Functions 12 April 17th 05 10:36 PM


All times are GMT +1. The time now is 12:15 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"