generate textbox on button click

lyntan

New Member
Joined
Sep 14, 2015
Messages
19
hello! please help!
how to generate textbox on button click?
i got this code :
ActiveSheet.Shapes.AddLabel(msoTextOrientationHorizontal, 2800, 900, 100, 30).Select

it works but its a plain box without background colour or border.
i need a coloured textbox on button click in excel.
please help ;( :(
 
Start the Macro recorder and create yourself another textbox color it the way you want and then run the script again.
This is a recorder it records everything you do and the saves the recording. Then when you click macro from the ribbon choose the macro and run it.
Do not create the textbox before stating the recorder. Start recording click on the textbox on the ribbon put the textbox where you want and then format its color and what else you want then stop the recorder.


If it works assign the macro to a button not to the textbox.
Do you know how to assign a macro to a button.
 
Last edited:
Upvote 0

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
I would suggest running the recorder again. Make a new box and try it again. Try running the script a few times from the macro menu on the ribbon if it works ok try assigning it to a button.

hello. thank you. it works after many attempts and figurations. thanks a lot. ! it really helps me a lot!
 
Upvote 0
Glad I was able to help you. Come back here to Mr. Excel next time you need additional assistance.
hello. thank you. it works after many attempts and figurations. thanks a lot. ! it really helps me a lot!
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,324
Members
452,635
Latest member
laura12345

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