Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
New Line in code to worksheet cell?
Good Evening Group,
Is it possible to force a new line by code after each textstring that goes into Sheets("Sheet1").Cells(1, 1). This cell is formated as "Wrap Text". The length of the textstring is variable. (See code below). Sheets("Sheet1").Cells(1, 1) = _ Sheets("Sheet2").Cells(1, 1) & " " & Sheets("Sheet2").Cells(1, 2) & " " & _ Sheets("Sheet2").Cells(1, 3) & " " & Sheets("Sheet21").Cells(1, 4) & " " & _ Sheets("Sheet2").Cells(1, 5) & " " & Sheets("Sheet2").Cells(1, 6) Grateful for any help. Brgds CG Rosén |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
New Line in code to worksheet cell?
Sheets("Sheet1").Cells(1, 1) = _
Sheets("Sheet2").Cells(1, 1) & chr(10) & _ Sheets("Sheet2").Cells(1, 2) & chr(10) & _ Sheets("Sheet2").Cells(1, 3) & chr(10) & _ Sheets("Sheet2").Cells(1, 4) & chr(10) & _ Sheets("Sheet2").Cells(1, 5) & chr(10) & _ Sheets("Sheet2").Cells(1, 6) -- Regards, Tom Ogilvy "CG Rosén" wrote in message ... Good Evening Group, Is it possible to force a new line by code after each textstring that goes into Sheets("Sheet1").Cells(1, 1). This cell is formated as "Wrap Text". The length of the textstring is variable. (See code below). Sheets("Sheet1").Cells(1, 1) = _ Sheets("Sheet2").Cells(1, 1) & " " & Sheets("Sheet2").Cells(1, 2) & " " & _ Sheets("Sheet2").Cells(1, 3) & " " & Sheets("Sheet21").Cells(1, 4) & " " & _ Sheets("Sheet2").Cells(1, 5) & " " & Sheets("Sheet2").Cells(1, 6) Grateful for any help. Brgds CG Rosén |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
New Line in code to worksheet cell?
Hi CG Rosén
Try With Sheets("Sheet2") Sheets("Sheet1").Cells(1, 1).Value = _ .Cells(1, 1).Value & Chr(10) & .Cells(1, 2).Value & Chr(10) & _ .Cells(1, 3).Value & Chr(10) & .Cells(1, 4).Value & Chr(10) & _ .Cells(1, 5).Value & Chr(10) & .Cells(1, 6).Value End With -- Regards Ron de Bruin http://www.rondebruin.nl "CG Rosén" wrote in message ... Good Evening Group, Is it possible to force a new line by code after each textstring that goes into Sheets("Sheet1").Cells(1, 1). This cell is formated as "Wrap Text". The length of the textstring is variable. (See code below). Sheets("Sheet1").Cells(1, 1) = _ Sheets("Sheet2").Cells(1, 1) & " " & Sheets("Sheet2").Cells(1, 2) & " " & _ Sheets("Sheet2").Cells(1, 3) & " " & Sheets("Sheet21").Cells(1, 4) & " " & _ Sheets("Sheet2").Cells(1, 5) & " " & Sheets("Sheet2").Cells(1, 6) Grateful for any help. Brgds CG Rosén |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro code to put series name next to individual line in line grap | Charts and Charting in Excel | |||
Copy a cell from another worksheet and create a line wrap | Excel Discussion (Misc queries) | |||
How to extract zip code from a 1 cell adress line? | Excel Discussion (Misc queries) | |||
New Line Code for Cell Format | Excel Discussion (Misc queries) | |||
How to insert line on other worksheet depending upon result in cell? | Excel Discussion (Misc queries) |