Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
IJ IJ is offline
external usenet poster
 
Posts: 9
Default Custom number format codes for negative numbers

Hello,

I am trying to find out what the custom number format code for creating only
negative numbers is?

All I want is to be able to give any cell, I choose in my worksheet, a
negative value so that I do not have to enter a negative sign or enter ( )
every time I input a number.

Any help or information any one may be able to provide will be greatly
appreciated.

Thanks for reading my inquiry.

Take care and KIP

IJ
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Custom number format codes for negative numbers

You cannot custom format a cell to become negative.

You can use event code to change the value as you enter a number.

With thanks to Bob Phillips for the basic code.

Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "A1:A10"
Dim cell As Range
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

This is event code and will go into the sheet module.

Right-click on a sheet tab and "View Code".

Copy/paste the event code into that module.

As you enter numbers in A1:A10 they will become negative.


Gord Dibben MS Excel MVP


On Thu, 7 Sep 2006 11:29:02 -0700, IJ wrote:

Hello,

I am trying to find out what the custom number format code for creating only
negative numbers is?

All I want is to be able to give any cell, I choose in my worksheet, a
negative value so that I do not have to enter a negative sign or enter ( )
every time I input a number.

Any help or information any one may be able to provide will be greatly
appreciated.

Thanks for reading my inquiry.

Take care and KIP

IJ


  #3   Report Post  
Posted to microsoft.public.excel.misc
IJ IJ is offline
external usenet poster
 
Posts: 9
Default Custom number format codes for negative numbers

Hello Mr. Dibben,

I would like to thank you and Mr. Phillips for your assistance...I really
appreciate the information and help.

I would like to ask if either you or Mr. Phillips knows if this coding can
be applied to a sepcific row or column in an Excel worksheet? Any
information either of you may be able to provide will, again, be greatly
appreciated. Thanks again !!!

Take care and KIP

Sincerely,

IJ

"Gord Dibben" wrote:

You cannot custom format a cell to become negative.

You can use event code to change the value as you enter a number.

With thanks to Bob Phillips for the basic code.

Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "A1:A10"
Dim cell As Range
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

This is event code and will go into the sheet module.

Right-click on a sheet tab and "View Code".

Copy/paste the event code into that module.

As you enter numbers in A1:A10 they will become negative.


Gord Dibben MS Excel MVP


On Thu, 7 Sep 2006 11:29:02 -0700, IJ wrote:

Hello,

I am trying to find out what the custom number format code for creating only
negative numbers is?

All I want is to be able to give any cell, I choose in my worksheet, a
negative value so that I do not have to enter a negative sign or enter ( )
every time I input a number.

Any help or information any one may be able to provide will be greatly
appreciated.

Thanks for reading my inquiry.

Take care and KIP

IJ



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Custom number format codes for negative numbers

You would change the parameters at the Const WS_RANGE as String line.

The code I posted used the range "A1:A10"

"A:A" would be column A
"A:E" would be columns A through E

"1:1" would be row 1
"1:6" would be rows 1 through 6


Gord


On Thu, 7 Sep 2006 12:45:02 -0700, IJ wrote:

Hello Mr. Dibben,

I would like to thank you and Mr. Phillips for your assistance...I really
appreciate the information and help.

I would like to ask if either you or Mr. Phillips knows if this coding can
be applied to a sepcific row or column in an Excel worksheet? Any
information either of you may be able to provide will, again, be greatly
appreciated. Thanks again !!!

Take care and KIP

Sincerely,

IJ

"Gord Dibben" wrote:

You cannot custom format a cell to become negative.

You can use event code to change the value as you enter a number.

With thanks to Bob Phillips for the basic code.

Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "A1:A10"
Dim cell As Range
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

This is event code and will go into the sheet module.

Right-click on a sheet tab and "View Code".

Copy/paste the event code into that module.

As you enter numbers in A1:A10 they will become negative.


Gord Dibben MS Excel MVP


On Thu, 7 Sep 2006 11:29:02 -0700, IJ wrote:

Hello,

I am trying to find out what the custom number format code for creating only
negative numbers is?

All I want is to be able to give any cell, I choose in my worksheet, a
negative value so that I do not have to enter a negative sign or enter ( )
every time I input a number.

Any help or information any one may be able to provide will be greatly
appreciated.

Thanks for reading my inquiry.

Take care and KIP

IJ




  #5   Report Post  
Posted to microsoft.public.excel.misc
IJ IJ is offline
external usenet poster
 
Posts: 9
Default Custom number format codes for negative numbers

Hello Mr. Dibben,

Thank you very much !!!! :)

I really appreciate you and Mr. Phillips taking the time to help me
out...Please thank him for me.

Thanks again !!!)

Take care and KIP

IJ :)

P.S. I want apologize in advance...it is possible that this post may come
omre than once as I did not get the post confirmed window my first time
around...
so I reposted. Thanks !! :)

"Gord Dibben" wrote:

You would change the parameters at the Const WS_RANGE as String line.

The code I posted used the range "A1:A10"

"A:A" would be column A
"A:E" would be columns A through E

"1:1" would be row 1
"1:6" would be rows 1 through 6


Gord


On Thu, 7 Sep 2006 12:45:02 -0700, IJ wrote:

Hello Mr. Dibben,

I would like to thank you and Mr. Phillips for your assistance...I really
appreciate the information and help.

I would like to ask if either you or Mr. Phillips knows if this coding can
be applied to a sepcific row or column in an Excel worksheet? Any
information either of you may be able to provide will, again, be greatly
appreciated. Thanks again !!!

Take care and KIP

Sincerely,

IJ

"Gord Dibben" wrote:

You cannot custom format a cell to become negative.

You can use event code to change the value as you enter a number.

With thanks to Bob Phillips for the basic code.

Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "A1:A10"
Dim cell As Range
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

This is event code and will go into the sheet module.

Right-click on a sheet tab and "View Code".

Copy/paste the event code into that module.

As you enter numbers in A1:A10 they will become negative.


Gord Dibben MS Excel MVP


On Thu, 7 Sep 2006 11:29:02 -0700, IJ wrote:

Hello,

I am trying to find out what the custom number format code for creating only
negative numbers is?

All I want is to be able to give any cell, I choose in my worksheet, a
negative value so that I do not have to enter a negative sign or enter ( )
every time I input a number.

Any help or information any one may be able to provide will be greatly
appreciated.

Thanks for reading my inquiry.

Take care and KIP

IJ






  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Custom number format codes for negative numbers

Mr. Phillips will see your posts.

Thanks for the feedback.


Gord

On Thu, 7 Sep 2006 13:25:01 -0700, IJ wrote:

Hello Mr. Dibben,

Thank you very much !!!! :)

I really appreciate you and Mr. Phillips taking the time to help me
out...Please thank him for me.

Thanks again !!!)

Take care and KIP

IJ :)

P.S. I want apologize in advance...it is possible that this post may come
omre than once as I did not get the post confirmed window my first time
around...
so I reposted. Thanks !! :)

"Gord Dibben" wrote:

You would change the parameters at the Const WS_RANGE as String line.

The code I posted used the range "A1:A10"

"A:A" would be column A
"A:E" would be columns A through E

"1:1" would be row 1
"1:6" would be rows 1 through 6


Gord


On Thu, 7 Sep 2006 12:45:02 -0700, IJ wrote:

Hello Mr. Dibben,

I would like to thank you and Mr. Phillips for your assistance...I really
appreciate the information and help.

I would like to ask if either you or Mr. Phillips knows if this coding can
be applied to a sepcific row or column in an Excel worksheet? Any
information either of you may be able to provide will, again, be greatly
appreciated. Thanks again !!!

Take care and KIP

Sincerely,

IJ

"Gord Dibben" wrote:

You cannot custom format a cell to become negative.

You can use event code to change the value as you enter a number.

With thanks to Bob Phillips for the basic code.

Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "A1:A10"
Dim cell As Range
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

This is event code and will go into the sheet module.

Right-click on a sheet tab and "View Code".

Copy/paste the event code into that module.

As you enter numbers in A1:A10 they will become negative.


Gord Dibben MS Excel MVP


On Thu, 7 Sep 2006 11:29:02 -0700, IJ wrote:

Hello,

I am trying to find out what the custom number format code for creating only
negative numbers is?

All I want is to be able to give any cell, I choose in my worksheet, a
negative value so that I do not have to enter a negative sign or enter ( )
every time I input a number.

Any help or information any one may be able to provide will be greatly
appreciated.

Thanks for reading my inquiry.

Take care and KIP

IJ





Gord Dibben MS Excel MVP
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
Convert numbers from text format to number format merlin68 Excel Discussion (Misc queries) 7 June 20th 07 07:03 PM
custom number and random text format CAD Teacher Excel Discussion (Misc queries) 0 June 21st 06 11:56 AM
Custom Number Format TimmerSuds Excel Discussion (Misc queries) 1 June 20th 06 03:29 PM
Cell will not format numbers correctly for a 13 digit custom barc. Laudan Excel Worksheet Functions 4 April 11th 05 08:13 PM
Custom number format E2engine Excel Worksheet Functions 10 December 4th 04 03:33 PM


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