View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Ed Ed is offline
external usenet poster
 
Posts: 279
Default How do I add text box styles to a worksheet?

Hi Jialiang,

Thanks for writing the macro. I am adjusting it for my needs.

I can not get the set autoshape defaults button to work for TextBoxes.
--
Ed


"Jialiang Ge [MSFT]" wrote:

Hello Ed,

To save the TextBox format in Excel 2003, we can right click on a formatted
Textbox, and choose "Set AutoShape Defaults" button. In this way, the
format will be automatically applied to all the newly added TextBoxes. If
we need to save multiple formats, I have to let you know that it is not a
supported feature in the current Excel version. Please feel free to submit
the feature request on https://connect.microsoft.com/default.aspx. The
developers from Excel product team may look at our requests and take them
into consideration when they develop the next version of Office.

For the current moment, a possible workaround is to record the formats as
several Excel macros (each macro corresponds to one TextBox format), and
run the macro on the TextBoxes that we need to format.

Here is a sample macro for your reference:

Sub Format1()
Selection.ShapeRange.Fill.Visible = msoTrue
Selection.ShapeRange.Fill.Solid
Selection.ShapeRange.Fill.ForeColor.SchemeColor = 41
Selection.ShapeRange.Fill.Transparency = 0#
Selection.ShapeRange.Line.Weight = 0.75
Selection.ShapeRange.Line.DashStyle = msoLineSolid
Selection.ShapeRange.Line.Style = msoLineSingle
Selection.ShapeRange.Line.Transparency = 0#
Selection.ShapeRange.Line.Visible = msoTrue
Selection.ShapeRange.Line.ForeColor.SchemeColor = 53
Selection.ShapeRange.Line.BackColor.RGB = RGB(255, 255, 255)
End Sub

Please let me know if you have any other concerns, or need anything else.

Regards,
Jialiang Ge , remove 'online.')
Microsoft Online Community Support

==================================================
For MSDN subscribers whose posts are left unanswered, please check this
document: http://blogs.msdn.com/msdnts/pages/postingAlias.aspx

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications. If you are using Outlook Express/Windows Mail, please make sure
you clear the check box "Tools/Options/Read: Get 300 headers at a time" to
see your reply promptly.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.