Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 99
Default Cell Format subtracting 1

I would like to format a cell that each time a number is typed in it will
subtract 1 from that number. I do not want to put a formula in another colum
to do this, just when I type in a 5 for example the 5 would change to a 4.
Can this be done?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,718
Default Cell Format subtracting 1

Simple, put 1 less of the actual number


"Wendy" wrote:

I would like to format a cell that each time a number is typed in it will
subtract 1 from that number. I do not want to put a formula in another colum
to do this, just when I type in a 5 for example the 5 would change to a 4.
Can this be done?

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,726
Default Cell Format subtracting 1

Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "H1" '<== 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 .Value = .Value - 1
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

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Wendy" wrote in message
...
I would like to format a cell that each time a number is typed in it will
subtract 1 from that number. I do not want to put a formula in another
colum
to do this, just when I type in a 5 for example the 5 would change to a 4.
Can this be done?



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,726
Default Cell Format subtracting 1

LOL! think of a number, and subtract 1.

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Teethless mama" wrote in message
...
Simple, put 1 less of the actual number


"Wendy" wrote:

I would like to format a cell that each time a number is typed in it will
subtract 1 from that number. I do not want to put a formula in another
colum
to do this, just when I type in a 5 for example the 5 would change to a
4.
Can this be done?



  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Cell Format subtracting 1

Wendy

How about a Spinner from the Forms toolbar.

Then you could go down or up as you choose.


Gord Dibben MS Excel MVP

On Tue, 6 Feb 2007 14:57:00 -0800, Wendy
wrote:

I would like to format a cell that each time a number is typed in it will
subtract 1 from that number. I do not want to put a formula in another colum
to do this, just when I type in a 5 for example the 5 would change to a 4.
Can this be done?


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
Custom functions calculating time arguments Help Desperate Bill_De Excel Worksheet Functions 12 April 25th 06 02:22 AM
Cell data format falloutx Excel Discussion (Misc queries) 1 February 10th 06 01:46 PM
Possible Lookup Table Karen Excel Worksheet Functions 5 June 8th 05 09:43 PM
can't format cell - have tried unlocking and unprotecting griffin Excel Discussion (Misc queries) 1 April 5th 05 02:11 AM
GET.CELL Biff Excel Worksheet Functions 2 November 24th 04 07:16 PM


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