+ Reply to Thread
Results 1 to 3 of 3

Read the text in a single cell line by line.

  1. #1
    Registered User
    Join Date
    02-14-2010
    Location
    Stockholm, Sweden
    MS-Off Ver
    Excel 2007
    Posts
    5

    Read the text in a single cell line by line.

    Hi All,

    Can anyone tell if there is a way to read the text in a single cell line by line using VBA?

    E.g. In a multiple line cell (written using Alt+Enter) containing this:

    Paul Smith
    22, Elk Street
    Smalltown

    I would like to use VBA and read the strings from the 3 lines in the cell into 3 different variables.

    Many thanks!

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Read the text in a single cell line by line.

    Assuming you've used Char(10) to add the line break then you can use Split accordingly, eg:

    Please Login or Register  to view this content.

    It follows that string variables may be moot - ie you could simply refer to vStrings(n) as and when required.

  3. #3
    Registered User
    Join Date
    02-14-2010
    Location
    Stockholm, Sweden
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Read the text in a single cell line by line.

    DonkeyOte,

    Thank you very much!

    It works exactly as I wanted.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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