Hi all,
Anyone know how to input 2 strings from vba into a single cell, like the following;
String 1
String 2
The code above puts the strings into the cell without a break.Cells(1, 1).Value = "M/C Group By: " & GroupMachine & " " & "Shift Group By: " & GroupShift
Any help appreciated!!
Taa laa
activecell.Value = "a" & chr(10) & "b"
Robin Hammond
www.enhanceddatasystems.com
"gti_jobert" <gti_jobert.22ynpz_1139486404.7817@excelforum-nospam.com> wrote
in message news:gti_jobert.22ynpz_1139486404.7817@excelforum-nospam.com...
>
> 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
>
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
Range("A1") = "String1" & Chr(10) & "String2"
maybe,
"gti_jobert" <gti_jobert.22ynpz_1139486404.7817@excelforum-nospam.com> wrote
in message news:gti_jobert.22ynpz_1139486404.7817@excelforum-nospam.com...
>
> 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
>
>
Make it
Range("A1")= String1 & CHR$(10) & String2 ( it is CHR$ not CHR )
A V Veerkar
"avveerkar" <avveerkar.22ypkm_1139488801.6268@excelforum-nospam.com> wrote
in message news:avveerkar.22ypkm_1139488801.6268@excelforum-nospam.com...
>
> ( 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
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks