ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Increase/decrease decimal code (https://www.excelbanter.com/excel-programming/283001-increase-decrease-decimal-code.html)

Chris

Increase/decrease decimal code
 
Hi all,

I've been digging through the VBA functions in search of
an easy way to increase/decrease the number of decimal
places shown in a cell. The purpose would be so that I
could use a shortcut macro key instead of having to go up
to the toolbar every time.

So far I've had no luck. Short of manually retrieving and
modifying the cell's NumberFormat property, anyone know of
a simple way to accomplish this?

Thanks for any help!
Chris

Tom Ogilvy

Increase/decrease decimal code
 
That is how you would do it. That is how it is set, so that is how you
would have to reset it.

--
Regards,
Tom Ogilvy

"Chris" wrote in message
...
Hi all,

I've been digging through the VBA functions in search of
an easy way to increase/decrease the number of decimal
places shown in a cell. The purpose would be so that I
could use a shortcut macro key instead of having to go up
to the toolbar every time.

So far I've had no luck. Short of manually retrieving and
modifying the cell's NumberFormat property, anyone know of
a simple way to accomplish this?

Thanks for any help!
Chris




Chip Pearson

Increase/decrease decimal code
 
Chris,

Here's one way:

Const cDecreaseDecimal = 399
Const cIncreaseDecimal = 398
Application.CommandBars.FindControl(ID:=cIncreaseD ecimal).Execute


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Chris" wrote in message
...
Hi all,

I've been digging through the VBA functions in search of
an easy way to increase/decrease the number of decimal
places shown in a cell. The purpose would be so that I
could use a shortcut macro key instead of having to go up
to the toolbar every time.

So far I've had no luck. Short of manually retrieving and
modifying the cell's NumberFormat property, anyone know of
a simple way to accomplish this?

Thanks for any help!
Chris




No Name

Increase/decrease decimal code
 
Worked like a charm, many thanks!

-----Original Message-----
Chris,

Here's one way:

Const cDecreaseDecimal = 399
Const cIncreaseDecimal = 398
Application.CommandBars.FindControl

(ID:=cIncreaseDecimal).Execute


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Chris" wrote in

message
...
Hi all,

I've been digging through the VBA functions in search of
an easy way to increase/decrease the number of decimal
places shown in a cell. The purpose would be so that I
could use a shortcut macro key instead of having to go

up
to the toolbar every time.

So far I've had no luck. Short of manually retrieving

and
modifying the cell's NumberFormat property, anyone know

of
a simple way to accomplish this?

Thanks for any help!
Chris



.



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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com