-
Solved: Multi-Line into a cell
I am trying to take multiple texboxes and concatinate them into one cell. However, when I do this, I get a "Square" after each value - assuming it is the vbNewLine? How can I get rid of that "Square"?????
[VBA]
'------------------------------------------
Private Sub FinishButton_Click()
Dim Msg As String, x As Integer
Dim row As Integer
Msg = PartNumber1.Value
For x = 2 To 10
With Me.Controls("PartNumber" & x)
If .Value <> "" Then Msg = Msg & vbNewLine & .Value
End With
Next x
row = Worksheets("POs").Range("A1:A65526").Find(POSeries.Value, , , xlWhole).row
If row = 0 Then Exit Sub
Range("g" & row).Value = Msg
End Sub
[/VBA]
Thanks,
Phil
-
Use Chr(10) instead of vbNewLine. What you're doing translates into an actual character on the worksheet. Chr(10) - CHAR(10) in a worksheet function - will not show up as the dreaded square. Something like this ..
[vba]Option Explicit
Sub ShowNoSquarePlease()
With ActiveCell
.Value = "a" & Chr(10) & "b" & Chr(10) & "c"
End With
End Sub[/vba]
-
The " Char(10) " worked... thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules