View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Troubled User Troubled User is offline
external usenet poster
 
Posts: 85
Default Text Box - Moving Formatted Text

Jim,

OK, I worked on this for several hours before seeing your response. I will
trust your judgement on altering the font after all the text has been moved.
So now I need to step through the source text character by character and
testing the font for bold and underlining. I created two string variables to
do this :

Dim TextBold As String
Dim TextUnd As String

I then changed the length to 1 via:

Text1 = Source1.Characters(Start:=x1, Length:=1).Text

and have tried to test Text1 using multiple different methods however I
can't get anything to return other than Invalid Qualifer errors. This got me
thinking that when I load the value into Text 1 that it need to have all its
text/font qualities, which I am not sure is the case if you load using .Text
as is above. Any help is greatly appreciated.

Thanks for any help you can provide. I will keep trying.


"Jim Rech" wrote:

I think I'd copy all the text and then work on the formatting.

--
Jim
"Troubled User" wrote in message
...
I don't want to copy the entire textbox (for multiple reason, including
that
I am doing this to about 50 different textboxes) anyway, I will try to
write
something that moves them one at a time with a test for bold / underline
for
each.

Thanks for your help. You will probably hear from me again!


"Jim Rech" wrote:

I think your choices are to either copy the text box as a whole or to set
the each character's bold and underline property one at a time.

--
Jim
"Troubled User" wrote in message
...
I am moving text from one textbox (from the drawing toolbar) on one
sheet
to
another textbox (on another sheet). I used these textboxes to allow
for
copy/paste functionality, which I couldn't make work using the
ControlToolbox
Textboxes . Anyway, when I move the data using the function below, It
does
not move the formats (underline / bold) of the moved text. Any help
would
be
appreciated.

Thank you.

Sub moveit

Dim x1 As Integer
Dim Source1 As TextBox
Dim Target1 As TextBox
Dim Text1 As String

Set Source1 = sht1.DrawingObjects(1)
Set Target1 = sht2.DrawingObjects(1)

For x1 = 1 To Source1.Characters.Count Step 250

' Place the first text box text into a variable called theText.
Text1 = Source1.Characters(Start:=x1, Length:=250).Text

' Place the value of theText variable into second text box.
Target1.Characters(Start:=x1, Length:=250).Text = Text1

Next

End Sub