I want to add a macro to a button so when a cell is selected within range E10:F20 and I click the macro button, the cell content becomes bold.
But if content already is bold, make content not bold
How do I achieve this?
I want to add a macro to a button so when a cell is selected within range E10:F20 and I click the macro button, the cell content becomes bold.
But if content already is bold, make content not bold
How do I achieve this?
Last edited by jokris; 06-08-2016 at 12:56 PM.
Hi there,
Try entering the following code in the VBA CodeModule of the worksheet for which you wish to provide this feature, and see if it does what you need:
The highlighted value may be altered to suit your own requirements.![]()
Please Login or Register to view this content.
Hope this helps - please let me know how you get on.
Regards,
Greg M
In the sheet module:
![]()
Please Login or Register to view this content.
Entia non sunt multiplicanda sine necessitate
It works good, thank you.
But how do I do if I want a macro button that (when clicked) switches selected cell between bold and blue vs not bold not blue within same range E10:F20?
Hi again,
See if the following code does what you need:
Select one or more cells and then run the macro to toggle the appearance of the cells.![]()
Please Login or Register to view this content.
Hope this helps - please let me know how you get on.
Regards,
Greg M
Greg, it's perfect!
Thank you!
Hi again,
Many thanks for your feedback and also for the Reputation increase - much appreciated
You're welcome - glad I was able to help.
Best regards,
Greg M
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks