Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 60
Default Format in text boxes with multiple text lines

I have an excel application which automatically adds textboxes when the user
clicks on a button. Each text box must accommodate two text lines: an upper
one and a lower one.

The upper line has bold 12-size bold arial font. This text line (text &
format) is generated by the code. The lower line is typed in by the user and
it must have a predefined format. I would like this line to be ready for my
users to start typing.

I would like to implement the following behavior in each textbox: whenever
the user clicks on the textbox the cursor must be on the lower text line,
which must have italic 10-size bold times new roman font: this lower line is
already formatted for the user to start typing. How can I accomplish this?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Format in text boxes with multiple text lines

This will work. I'm not sure which type texttboxes yo are dealing with. The
olebojects didn't work for me but this did.

Sub test()

Set NewBox = Worksheets(1).Shapes.AddTextbox(msoTextOrientation Horizontal, _
100, 100, 200, 50)

With NewBox.TextFrame
FirstRow = "Joel"
.Characters.Text = FirstRow & Chr(10)
BoxLen = Len(.Characters.Text)

.Characters(Start:=1, Length:=4).Font.Size = 12
.Characters(Start:=BoxLen, Length:=1).Font.Size = 10
End With

End Sub

"Jess" wrote:

I have an excel application which automatically adds textboxes when the user
clicks on a button. Each text box must accommodate two text lines: an upper
one and a lower one.

The upper line has bold 12-size bold arial font. This text line (text &
format) is generated by the code. The lower line is typed in by the user and
it must have a predefined format. I would like this line to be ready for my
users to start typing.

I would like to implement the following behavior in each textbox: whenever
the user clicks on the textbox the cursor must be on the lower text line,
which must have italic 10-size bold times new roman font: this lower line is
already formatted for the user to start typing. How can I accomplish this?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
User Form Text Boxes - Copy format of text boxes NDBC Excel Discussion (Misc queries) 3 July 2nd 09 02:02 AM
Setting an array of text boxes equal to individual form text boxes lcaretto Excel Programming 6 September 19th 08 04:19 PM
Format Text Boxes amit Excel Programming 3 April 17th 08 08:17 AM
Display multiple lines of text within a cell from multiple column. Zeeshan Zaheer Excel Worksheet Functions 3 August 23rd 06 10:08 AM
Mysteriously Shifting Lines and Text Boxes Wendy F Charts and Charting in Excel 1 March 3rd 06 03:58 AM


All times are GMT +1. The time now is 10:31 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"