Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default 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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default 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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default 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




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default 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





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there a way to insert a soft return into a single cell Jax_R Excel Discussion (Misc queries) 2 June 5th 07 07:12 PM
soft return Josie Excel Discussion (Misc queries) 4 May 18th 06 05:23 PM
Code equivalent to the Enter-Key JMay Excel Programming 7 May 23rd 04 08:44 PM
VBA equivalent to "Return/Enter" Key JMay Excel Programming 7 October 8th 03 11:54 AM


All times are GMT +1. The time now is 01:29 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"