Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Multiple lines in single cell


Hi all,

Anyone know how to input 2 strings from vba into a single cell, like
the following;

String 1
String 2


Code:
--------------------

Cells(1, 1).Value = "M/C Group By: " & GroupMachine & " " & "Shift Group By: " & GroupShift

--------------------


The code above puts the strings into the cell without a break.

Any help appreciated!!

Taa laa


--
gti_jobert
------------------------------------------------------------------------
gti_jobert's Profile: http://www.excelforum.com/member.php...o&userid=30634
View this thread: http://www.excelforum.com/showthread...hreadid=510524

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 575
Default Multiple lines in single cell

activecell.Value = "a" & chr(10) & "b"

Robin Hammond
www.enhanceddatasystems.com

"gti_jobert" wrote
in message ...

Hi all,

Anyone know how to input 2 strings from vba into a single cell, like
the following;

String 1
String 2


Code:
--------------------

Cells(1, 1).Value = "M/C Group By: " & GroupMachine & " " & "Shift Group
By: " & GroupShift

--------------------


The code above puts the strings into the cell without a break.

Any help appreciated!!

Taa laa


--
gti_jobert
------------------------------------------------------------------------
gti_jobert's Profile:
http://www.excelforum.com/member.php...o&userid=30634
View this thread: http://www.excelforum.com/showthread...hreadid=510524



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Multiple lines in single cell


Hey,

I had originally did as you tried but got a square inbetween my strings
within the cell, found out that the cell first has to be formatted using
'Wrap Text box'.

Taa


--
gti_jobert
------------------------------------------------------------------------
gti_jobert's Profile: http://www.excelforum.com/member.php...o&userid=30634
View this thread: http://www.excelforum.com/showthread...hreadid=510524

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 430
Default Multiple lines in single cell

Range("A1") = "String1" & Chr(10) & "String2"

maybe,

"gti_jobert" wrote
in message ...

Hi all,

Anyone know how to input 2 strings from vba into a single cell, like
the following;

String 1
String 2


Code:
--------------------

Cells(1, 1).Value = "M/C Group By: " & GroupMachine & " " & "Shift Group
By: " & GroupShift

--------------------


The code above puts the strings into the cell without a break.

Any help appreciated!!

Taa laa


--
gti_jobert
------------------------------------------------------------------------
gti_jobert's Profile:
http://www.excelforum.com/member.php...o&userid=30634
View this thread: http://www.excelforum.com/showthread...hreadid=510524




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Multiple lines in single cell


Make it
Range("A1")= String1 & CHR$(10) & String2 ( it is CHR$ not CHR )

A V Veerkar


--
avveerkar
------------------------------------------------------------------------
avveerkar's Profile: http://www.excelforum.com/member.php...o&userid=30338
View this thread: http://www.excelforum.com/showthread...hreadid=510524



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Multiple lines in single cell


"avveerkar" wrote
in message ...

( it is CHR$ not CHR )


It's both. And there's very little to choose between the two. Chr$ is
marginally more efficient, but will make such a disappearingly small
improvement in an average Excel/VBA application that, in reality, it matters
not which you use.

Robert


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
Add several lines of data in a single cell on a excell worksheet Huber57 Excel Discussion (Misc queries) 0 February 26th 10 04:31 PM
Mulitple text lines in a single cell Mrs.Aguire New Users to Excel 2 March 7th 09 02:31 AM
How to split wrapped text in a single cell into multiple lines Dr Fumanchu Excel Discussion (Misc queries) 2 February 27th 08 01:30 PM
Need to add 2 or more lines of data into a single cell in Excel Susan Excel Discussion (Misc queries) 2 July 31st 07 06:50 AM
Importing Multiple lines of text in a single Excel Cel filmfatale Excel Programming 1 December 8th 03 08:33 PM


All times are GMT +1. The time now is 04:54 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"