Increase/decrease decimal code

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
 
T

Tom Ogilvy

That is how you would do it. That is how it is set, so that is how you
would have to reset it.
 
C

Chip Pearson

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
 
G

Guest

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





.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top