Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / March 2007

Tip: Looking for answers? Try searching our database.

Importing text into a Text Box

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Francis Hookham - 28 Mar 2007 12:02 GMT
C1:C7 Sheets("Page") contain details of the particular job.

I am trying to write a macro to add a Text box on another sheet "Schedule"
to include these details.

Recording a macro of the first few operations, initially typing the text, I
have then attempted to use the variable 'JobDetail' (defined elsewhere and
used throughout the workbook) to replace the text in the recorded macro but
it does not appear in the text box when the macro is run.

Any suggestions for bringing into the text box C1, C2, C3 etc fro the other
sheet?

Thanks in anticipation.

Francis Hookham

Sub JobTextBox()

Sheets("Page").Cells(1, 3) = JobDetail

ActiveSheet.Shapes.AddTextbox(msoTextOrientationHorizontal, 72.75, 214.5, _

       199.5, 246.75).Select

   Selection.Characters.Text = "Project:" & Chr(10) & JobDetail & Chr(10) &
"Job No:" & Chr(10) & "   00234" & Chr(10) & ""

   With Selection.Characters(Start:=1, Length:=10).Font

       .Name = "Arial"

       .FontStyle = "Bold"

       .Size = 10

       .Strikethrough = False

       .Superscript = False

       .Subscript = False

       .OutlineFont = False

       .Shadow = False

       .Underline = xlUnderlineStyleNone

       .ColorIndex = xlAutomatic

   End With

   With Selection.Font

       .Name = "Arial"

       .FontStyle = "Regular"

       .Size = 12

       .Strikethrough = False

       .Superscript = False

       .Subscript = False

       .OutlineFont = False

       .Shadow = False

       .Underline = xlUnderlineStyleNone

       .ColorIndex = xlAutomatic

   End With

   With Selection.Characters(Start:=31, Length:=8).Font

       .Name = "Arial"

       .FontStyle = "Bold"

       .Size = 10

       .Strikethrough = False

       .Superscript = False

       .Subscript = False

       .OutlineFont = False

       .Shadow = False

       .Underline = xlUnderlineStyleNone

       .ColorIndex = xlAutomatic

   End With

   With Selection.Characters(Start:=39, Length:=9).Font

       .Name = "Arial"

       .FontStyle = "Regular"

       .Size = 12

       .Strikethrough = False

       .Superscript = False

       .Subscript = False

       .OutlineFont = False

       .Shadow = False

       .Underline = xlUnderlineStyleNone

       .ColorIndex = xlAutomatic

   End With

End Sub
CLR - 28 Mar 2007 18:50 GMT
You can CONCATENATE c1:c7 into a helper cell, say A1 and then in the TEXT box
call =Page!A1

hth
Vaya con Dios,
Chuck, CABGx3

> C1:C7 Sheets("Page") contain details of the particular job.
>
[quoted text clipped - 121 lines]
>
> End Sub
Francis Hookham - 28 Mar 2007 19:23 GMT
Thanks - sounds good - I'll try that

Francis

> You can CONCATENATE c1:c7 into a helper cell, say A1 and then in the TEXT
> box
[quoted text clipped - 136 lines]
>>
>> End Sub
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.