Forum Discussion
Abedules
Mar 22, 2020Copper Contributor
Creating Macro for Text Box
I am learning about macros in excel. So far I have opened a worksheet, clicked in a cell (D5), recorded a macro of inserting a text box and colouring it brown. The macro is saved in Personal.XLSB ...
- Mar 22, 2020
Try this one
Sub Create_Brown_Text_Box() ' Create_Brown_Text_Box Macro X = ActiveCell.Left Y = ActiveCell.Top ActiveSheet.Shapes.AddTextbox(msoTextOrientationHorizontal, X, Y, 109.2, _ 77.4).Select With Selection.ShapeRange.Fill .Visible = msoTrue .ForeColor.ObjectThemeColor = msoThemeColorAccent2 .ForeColor.TintAndShade = 0 .ForeColor.Brightness = -0.5 .Transparency = 0 .Solid End With End Sub
Abedules
Mar 22, 2020Copper Contributor
Many thanks for your suggestion.
The macro program suggested I remove the "underscore" in the measurements but apart from that all great.
It has given me a much better understanding.
Many thanks for your help.
Riny_van_Eekelen
Mar 22, 2020Platinum Contributor
Abedules You're welcome!
Didn't bother to delete the underscore. It came from your own code and I just made som small modifications to make it work.
- AbedulesMar 22, 2020Copper Contributor
No probs, now working on some other ideas based on your guidance.
Many thanks