Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have the following problem:
I often want to change the position of the decimal place in a cel (i.e., change its NumberFormat). However, i am too lazy to use the toolbar button. Instead, I need something i can bind to a shortcutkey. Unfortunately, recording the macro yields no interesting results. Is there a simple, general way to do what I am thinking of, or must the code for such a macro be necessarily long? Any help would be appreciated! Thanks. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
something like
c=c.offset*17.5% c.numberformat="0.00" Peter -----Original Message----- I have the following problem: I often want to change the position of the decimal place in a cel (i.e., change its NumberFormat). However, i am too lazy to use the toolbar button. Instead, I need something i can bind to a shortcutkey. Unfortunately, recording the macro yields no interesting results. Is there a simple, general way to do what I am thinking of, or must the code for such a macro be necessarily long? Any help would be appreciated! Thanks. . |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I had not thought of doing that (didn't know it was possible)! Thanks,
Dave. "Dave Peterson" wrote in message ... You could write a routine that would parse the .numberformat of each cell in the selection, but man, there's lots of .numberformats that those buttons respect! Maybe just running the buttons: Option Explicit Sub increaseDecimal() Application.CommandBars("formatting").FindControl( ID:=398).Execute End Sub Sub decreasedecimal() Application.CommandBars("formatting").FindControl( ID:=399).Execute End Sub R Avery wrote: No, what I am looking for is a lot more general. I want to have a macro called "IncrementDecimal", or something like that, so that when i press the shortcutkey it is bound to, it will increase the decimal of all cells in the selection by 1, just like the button on the toolbar. Similarly, I would want a "DecrementDecimal" macro that would do the reverse. For example, if i had cells A1:A3 like this $1,030.45 45.813% 1.1 Then the "DecrementDecimal" macro would, if A1:A3 is selected, change it to the following: $1,030.5 45.81% 1 -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro to increase to next column | Excel Discussion (Misc queries) | |||
Increase & Decrease Decimal Place | Excel Worksheet Functions | |||
increase/decrease decimal | Excel Worksheet Functions | |||
Increase number of macro names | Excel Worksheet Functions | |||
Increase/decrease decimal code | Excel Programming |