Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 13
Default SET DEFAULT VALUES IN CELL TO RECORD NEGATIVE

I would like to set the deufault values of a range of cells in my spread
sheet to negative.

EXAMPLE - If I had to type in -212, when I type in the cell 212 it should
autmatically record the same as -212.

Is there a way I can set the cell values so ths can be accomplished

Prasad
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,393
Default SET DEFAULT VALUES IN CELL TO RECORD NEGATIVE

No but you can type a range of numbers, then in an unused cell (say Z1)
enter -1
Copy Z1
Select all of the aforesaid range, use Edit |Paste Special and check the
Multiple box, click OK
Now delete Z1
done
best wishes
--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"Prasad Gopinath" wrote in
message ...
I would like to set the deufault values of a range of cells in my spread
sheet to negative.

EXAMPLE - If I had to type in -212, when I type in the cell 212 it should
autmatically record the same as -212.

Is there a way I can set the cell values so ths can be accomplished

Prasad



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default SET DEFAULT VALUES IN CELL TO RECORD NEGATIVE

You cannot pre-format the cells as negative.

You could use event code to change them to negative as you enter.

Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range("A1:A10")) Is Nothing Then
With Target
If .Value < "" Then
.Value = .Value * -1
End If
End With
End If
ws_exit:
Application.EnableEvents = True
End Sub

Right-click on the sheet tab and "View Code"

Copy/paste the above into that module.

Edit the range of A1:A10 to suit.


Gord Dibben MS Excel MVP

On Thu, 23 Nov 2006 10:48:02 -0800, Prasad Gopinath
wrote:

I would like to set the deufault values of a range of cells in my spread
sheet to negative.

EXAMPLE - If I had to type in -212, when I type in the cell 212 it should
autmatically record the same as -212.

Is there a way I can set the cell values so ths can be accomplished

Prasad


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 47
Default SET DEFAULT VALUES IN CELL TO RECORD NEGATIVE

Format Category Custom and use ##"-"##

"Gord Dibben" wrote:

You cannot pre-format the cells as negative.

You could use event code to change them to negative as you enter.

Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range("A1:A10")) Is Nothing Then
With Target
If .Value < "" Then
.Value = .Value * -1
End If
End With
End If
ws_exit:
Application.EnableEvents = True
End Sub

Right-click on the sheet tab and "View Code"

Copy/paste the above into that module.

Edit the range of A1:A10 to suit.


Gord Dibben MS Excel MVP

On Thu, 23 Nov 2006 10:48:02 -0800, Prasad Gopinath
wrote:

I would like to set the deufault values of a range of cells in my spread
sheet to negative.

EXAMPLE - If I had to type in -212, when I type in the cell 212 it should
autmatically record the same as -212.

Is there a way I can set the cell values so ths can be accomplished

Prasad



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
Using an offset formula for the reference in a relative reference Cuda Excel Worksheet Functions 6 November 15th 06 05:12 PM
Compiling macro based on cell values simonsmith Excel Discussion (Misc queries) 1 May 16th 06 08:31 PM
Custom functions calculating time arguments Help Desperate Bill_De Excel Worksheet Functions 12 April 25th 06 02:22 AM
Cell linked to a range of cell values in different sheet szeng Excel Discussion (Misc queries) 1 August 9th 05 02:41 AM
Copy cell format to cell on another worksht and update automatical kevinm Excel Worksheet Functions 21 May 19th 05 11:07 AM


All times are GMT +1. The time now is 09:55 AM.

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"