Increase/decrease decimal code

  • Thread starter Thread starter Chris
  • Start date Start date
C

Chris

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
 
That is how you would do it. That is how it is set, so that is how you
would have to reset it.
 
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
 
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





.
 
Back
Top