View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Ron de Bruin Ron de Bruin is offline
external usenet poster
 
Posts: 11,123
Default 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