ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Asci equivalent of soft return (alt+enter) (https://www.excelbanter.com/excel-programming/354186-asci-equivalent-soft-return-alt-enter.html)

Andibevan

Asci equivalent of soft return (alt+enter)
 
Hi All,

What is the asci combination required to create the equivalent of pressing
alt+enter when in a cell?

I.e. I want to print the words "Cat" and "Mat" in the same cell but on
different lines using VBA?

TIA

Andi



Gary''s Student

Asci equivalent of soft return (alt+enter)
 
Try:


Sub trial()
Cells(5, 1).Value = "Cat" & Chr(10) & "Mat"
End Sub

--
Gary's Student


"Andibevan" wrote:

Hi All,

What is the asci combination required to create the equivalent of pressing
alt+enter when in a cell?

I.e. I want to print the words "Cat" and "Mat" in the same cell but on
different lines using VBA?

TIA

Andi




Peter T

Asci equivalent of soft return (alt+enter)
 
With ActiveCell
..Value = "Cat" & vbLf & "Mat"
..WrapText = True ' normally done automaically
End With

Regards,
Peter T



"Andibevan" wrote in message
...
Hi All,

What is the asci combination required to create the equivalent of pressing
alt+enter when in a cell?

I.e. I want to print the words "Cat" and "Mat" in the same cell but on
different lines using VBA?

TIA

Andi





Andibevan

Asci equivalent of soft return (alt+enter)
 
Thank's


"Gary''s Student" wrote in message
...
Try:


Sub trial()
Cells(5, 1).Value = "Cat" & Chr(10) & "Mat"
End Sub

--
Gary's Student


"Andibevan" wrote:

Hi All,

What is the asci combination required to create the equivalent of

pressing
alt+enter when in a cell?

I.e. I want to print the words "Cat" and "Mat" in the same cell but on
different lines using VBA?

TIA

Andi







All times are GMT +1. The time now is 05:35 AM.

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