Thanks Dave, it works beautifully. I didn't realise that you could refer
to a text box from the Drawing Toolbar as a text box, I assumed it would
have to be referred to as a shape.
Regards
Andrew
Dave Peterson wrote:
http://support.microsoft.com/kb/q148815/
How to Copy Text to TextBoxes Using the Characters Method
And since you're working with textboxes, I'd just declare those things as
textboxes...
Option Explicit
Sub testme()
Call LoadBox("fbox", "tbox")
End Sub
Sub LoadBox(fbox As String, tbox As String)
Dim F1 As TextBox
Dim T1 As TextBox
Dim i As Long
Set F1 = ActiveSheet.TextBoxes(fbox)
Set T1 = ActiveSheet.TextBoxes(tbox)
T1.Text = ""
For i = 1 To F1.Characters.Count Step 250
T1.Characters(i).Insert _
String:=F1.Characters(Start:=i, Length:=250).Text
Next i
End Sub
(I think it makes it easier than using the shapes collection.)