A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

cell to stay same



 
 
Thread Tools Display Modes
  #1  
Old November 9th, 2009, 08:01 PM posted to microsoft.public.excel.misc
Pammy
external usenet poster
 
Posts: 181
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  
Old November 9th, 2009, 08:09 PM posted to microsoft.public.excel.misc
Pammy
external usenet poster
 
Posts: 181
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  
Old November 9th, 2009, 10:41 PM posted to microsoft.public.excel.misc
Gord Dibben
external usenet poster
 
Posts: 20,252
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?


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 05:06 AM.


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