PC Review


Reply
Thread Tools Rate Thread

Importing text into a Text Box

 
 
Francis Hookham
Guest
Posts: n/a
 
      28th Mar 2007
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


 
Reply With Quote
 
 
 
 
=?Utf-8?B?Q0xS?=
Guest
Posts: n/a
 
      28th Mar 2007
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




"Francis Hookham" wrote:

> 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
>
>
>

 
Reply With Quote
 
Francis Hookham
Guest
Posts: n/a
 
      28th Mar 2007
Thanks - sounds good - I'll try that

Francis

"CLR" <(E-Mail Removed)> wrote in message
news:B3A2C18E-2D15-4D07-928C-(E-Mail Removed)...
> 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
>
>
>
>
> "Francis Hookham" wrote:
>
>> 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
>>
>>
>>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
importing external data from text file erroneously converts text d Dan K Microsoft Access External Data 0 18th Feb 2009 03:26 PM
Importing Text file....need to manipulate text and spread across multiple columns. scottya Microsoft Excel Misc 1 19th May 2004 11:35 PM
Importing date fields that are stored as text in fixed width text file David Microsoft Access External Data 1 1st Oct 2003 05:26 PM
Importing page of text into Text-box on P-point Slide Bruce Nagler Microsoft Powerpoint 1 18th Jul 2003 08:43 PM
Importing a page of MS-WORD text into a Text-box of a Slide Bruce A. Nagler Microsoft Powerpoint 3 18th Jul 2003 04:02 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:19 PM.