how to add the property of color and lines for command button VBA in excel 2013 VBA

NimishK

Well-known Member
Joined
Sep 4, 2015
Messages
684
it seems techincal error

somehow i cant
add the property of color and lines for command button VBA in excel 2013 VBA as compared to excel 2007 where there was the option in Format control : Color and Lines Fill with your selected background colour for command button in the worksheet

Any ideas how can i acheive this

Regards

NimishK
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Background colour is just BackColor property, font colour is the ForeColor property.

Code:
cmdButton1.BackColour = RGB(red,green,blue)

works for me in XL2013

Editted, sorry I thought you meant in VBA. You can't from the main window. You might be able to do it from VBA by manipulating the Shape object that defines the button.
 
Last edited:
Upvote 0
If you need a coloured button, you can insert a rectangle, format that (background only) and adjust the Shadow to the colours you want so it looks like a button.

Then right click and assign to a macro.
 
Upvote 0
By the way has MS disabled the option of Color and Lines Format control for higher version of excel 2010 and onwards. Any reasons for not incorporating this option ?

If you need a coloured button, you can insert a rectangle, format that (background only) and adjust the Shadow to the colours you want so it looks like a button.
Will this act like command button because i've not tried this way. Seems bit complicated. thanks anyways
 
Upvote 0
Also in ribbon Format MENU in drawing tools is disabled when command button is highlighted. except for some few options
 
Last edited:
Upvote 0
By the way i've incorporated the Command Button in Worksheet and this is also not ActiveX control command button
 
Upvote 0
it doesn't matter if it's an ActiveX or not, neither will let you change the colours.

Yes, assigning a macro to a shape makes the shape work like a button. it can be any shape which is in someways better! You can have a rectangle with rounded corners, or even a round button (which is better still you might say, it looks like a proper button). You can even have a picture and assign a macro to it.

Microsoft unfortunately have a habit of removing useful features. At one time you could enter say 55+3 or 55-3 into a cell and it would add the '='. Blindingly obvious, you could change it to text if you wanted but most people would want it to act as a sum. But that got taken away about 20 years ago. Or you used to be able to set arrays to start numbering at 1 instead of the default 0. Now you can't. Who knows why they do these things. Miraculously they haven't stopped SumProduct to work in array mode (Yet!)
 
Upvote 0

Forum statistics

Threads
1,214,790
Messages
6,121,607
Members
449,037
Latest member
Arbind kumar

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top