I started learning about macros a few weeks ago, and currently I’m stuck with this challenge.
I would like to create a macro and then associate it to a shortcut that increases/ decreases the decimal by one to the cells I have selected, without changing the format of the cells in case they have different format between them.
What I want the macro to do is, for example:
If i have selected cells A1 and B1 that contain 10,0% and 1,0, respectively. By running the macro through a shortcut (for example “Ctrl + ,”) the values of the cells to increase by one decimal point to 10,00% and 1,00.
I would also like that when using another shortcut (for example “Ctrl + .”) to decrease the number of decimals of the selected cells, to 10% and 1.
I’ve only been able to increase/decrease the decimals, but the format of one of the cells changes to %, given that is the format of the first cell (A1).
In conclusion, I would like the macro to increase/decrease the decimal points without changing the format, no matter what it is.
I know I need to have 2 separate macros, one for increase decimals and one to decrease, but I haven’t find any solution for my problem online.
Thanks in advanced.
Benjamin Delgado is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.