Results 1 to 3 of 3

How to display the arrays with line spcae in between, within a cell?

Threaded View

  1. #1
    Registered User
    Join Date
    07-06-2012
    Location
    chennai
    MS-Off Ver
    Excel 2003
    Posts
    12

    How to display the arrays with line spcae in between, within a cell?

    I have a set of arrays(say 3 arrays) and I want to display them within a cell. My code is as below,

    Sub example()
    Dim Arr(3) As String
         Arr(0) = "First Line"
         Arr(1) = "Second Line"
         Arr(2) = "Thrid Line"
         
        Cells(1, 1).Value = Arr(0) & Arr(1) & Arr(2)
    End Sub
    Output: First LineSecond LineThrid Line

    But the problem is I them to display them with line spacing between each array within the same cell (1,1).

    My desired output:
    First Line
    Second Line
    Thrid Line

    Within the same cell(1,1)

    I used Char(10), but its displaying complie error as Sub or Function not defined.


    Please help me with correct code.
    Last edited by Rahul888; 08-18-2012 at 11:20 AM. Reason: Added code tags

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1