#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 96
Default cell to stay same

If I enter a 2 in a cell, I want it to always show as a -2.
Anytime I type 2, if comes in as -2. Is there a way to do this?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 96
Default cell to stay same

I want the cell to always be a negative, I misunderstood what was asked me.
Thanks,

"Pammy" wrote:

If I enter a 2 in a cell, I want it to always show as a -2.
Anytime I type 2, if comes in as -2. Is there a way to do this?

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default cell to stay same

Only with VBA event code or a helper cell.

Helper cell formula. =A1*-1

Event code.

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


Gord Dibben MS Excel MVP

On Mon, 9 Nov 2009 12:09:01 -0800, Pammy
wrote:

I want the cell to always be a negative, I misunderstood what was asked me.
Thanks,

"Pammy" wrote:

If I enter a 2 in a cell, I want it to always show as a -2.
Anytime I type 2, if comes in as -2. Is there a way to do this?


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
Insert a picture into an excel cell & have it stay there elizaj13 Excel Discussion (Misc queries) 4 April 13th 10 11:53 PM
how to inset a picture in a cell and make it stay in that cell Louis111 Excel Discussion (Misc queries) 4 March 5th 08 09:15 PM
How do I post a picture into a cell and have it stay there? rtk Excel Worksheet Functions 1 January 29th 07 12:21 AM
How do you stay in cell and get to next line??? Kati eM. Excel Discussion (Misc queries) 7 April 21st 06 05:55 PM
Why data in cell doesn't stay aligned with cell borders when prin. Danno Excel Discussion (Misc queries) 0 October 3rd 05 07:15 PM


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