ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Combine Strings into One String (https://www.excelbanter.com/excel-programming/324895-combine-strings-into-one-string.html)

Adam

Combine Strings into One String
 
I need to create a bookmark into Word, but I have all these strings. Is there
a method to combine these strings into one string; however have each string
as a paragraph??

Example Code:
String1 = "All Preparation Work as Stated Above"
x.Selection.TypeText String1 & vbCr

String2 = Worksheets("Bid").Cells(1, 15).Value & " : " & "Apply " &
Worksheets("Bid").Cells(i, 15).Value & " coats interior flat latex paint of
highest quality"
x.Selection.TypeText String2 & vbCr

String3 = Worksheets("Bid").Cells(1, 20).Value & " : " & "Apply " &
Worksheets("Bid").Cells(i, 20).Value & " coats interior flat latex paint of
highest quality"
x.Selection.TypeText String3 & vbCr

Thanks

Myrna Larson

Combine Strings into One String
 
Have you posted in the Word VBA/programming group?

On Tue, 8 Mar 2005 18:11:02 -0800, "Adam"
wrote:

I need to create a bookmark into Word, but I have all these strings. Is there
a method to combine these strings into one string; however have each string
as a paragraph??

Example Code:
String1 = "All Preparation Work as Stated Above"
x.Selection.TypeText String1 & vbCr

String2 = Worksheets("Bid").Cells(1, 15).Value & " : " & "Apply " &
Worksheets("Bid").Cells(i, 15).Value & " coats interior flat latex paint of
highest quality"
x.Selection.TypeText String2 & vbCr

String3 = Worksheets("Bid").Cells(1, 20).Value & " : " & "Apply " &
Worksheets("Bid").Cells(i, 20).Value & " coats interior flat latex paint of
highest quality"
x.Selection.TypeText String3 & vbCr

Thanks



NickHK

Combine Strings into One String
 
Adam
String1 =String1 & NextLotOfTextWithOrWithoutvbCr

x.Selection.TypeText String1

NickHK

"Adam" wrote in message
...
I need to create a bookmark into Word, but I have all these strings. Is

there
a method to combine these strings into one string; however have each

string
as a paragraph??

Example Code:
String1 = "All Preparation Work as Stated Above"
x.Selection.TypeText String1 & vbCr

String2 = Worksheets("Bid").Cells(1, 15).Value & " : " & "Apply " &
Worksheets("Bid").Cells(i, 15).Value & " coats interior flat latex paint

of
highest quality"
x.Selection.TypeText String2 & vbCr

String3 = Worksheets("Bid").Cells(1, 20).Value & " : " & "Apply " &
Worksheets("Bid").Cells(i, 20).Value & " coats interior flat latex paint

of
highest quality"
x.Selection.TypeText String3 & vbCr

Thanks




AA2e72E

Combine Strings into One String
 
Use x.Selection.TypeParagraph instead of x.Selection.TypeText; also, send
each string separately to Word.

"Adam" wrote:

I need to create a bookmark into Word, but I have all these strings. Is there
a method to combine these strings into one string; however have each string
as a paragraph??

Example Code:
String1 = "All Preparation Work as Stated Above"
x.Selection.TypeText String1 & vbCr

String2 = Worksheets("Bid").Cells(1, 15).Value & " : " & "Apply " &
Worksheets("Bid").Cells(i, 15).Value & " coats interior flat latex paint of
highest quality"
x.Selection.TypeText String2 & vbCr

String3 = Worksheets("Bid").Cells(1, 20).Value & " : " & "Apply " &
Worksheets("Bid").Cells(i, 20).Value & " coats interior flat latex paint of
highest quality"
x.Selection.TypeText String3 & vbCr

Thanks



All times are GMT +1. The time now is 11:44 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com