+ Reply to Thread
Results 1 to 7 of 7

splitting data into columns

Hybrid View

  1. #1
    Registered User
    Join Date
    04-13-2008
    Posts
    24

    splitting data into columns

    hi!

    I guess this is a typical novice question.
    Is there a way to split a data column horizontally? (please see attached)

    Many thanks!
    Attached Files Attached Files

  2. #2
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229
    Tools> Text to Columns will do what you need.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  3. #3
    Registered User
    Join Date
    04-13-2008
    Posts
    24
    thanks mike!
    I meant vertically. sorry for the mistake.

  4. #4
    Forum Contributor
    Join Date
    03-25-2008
    MS-Off Ver
    Excel, Outlook, Word 2007/2003
    Posts
    245
    Sub one_letter_per_column()
    Dim ws As Worksheet
    Dim cell As Range
    Dim vloop As Long
    Set ws = Worksheets("Sheet1")
    For Each cell In ws.Range("A2:A" & ws.Range("A" & _
        Rows.Count).End(xlUp).Row)
        For vloop = 1 To Len(cell)
            cell.Offset(, vloop + 1).Value = Mid(cell, vloop, 1)
        Next vloop
    Next cell
    End Sub
    Charlize

  5. #5
    Registered User
    Join Date
    04-13-2008
    Posts
    24

    Smile

    hi Charlize,

    sorry for the late reply.
    reason: I just learnt how to use macros today.
    your code works neatly.
    one outstanding question:
    it didn't seem responding when i tried to run it on the second sheet of the same file.
    any hint?

    regards

  6. #6
    Forum Contributor
    Join Date
    03-25-2008
    MS-Off Ver
    Excel, Outlook, Word 2007/2003
    Posts
    245
    Change
    Set ws = Worksheets("Sheet1")
    to
    Set ws = ActiveSheet
    Charlize

+ 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