Results 1 to 3 of 3

Thread: [Excel 2016] Using VBA to Split Colums

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2017
    Posts
    1

    [Excel 2016] Using VBA to Split Colums

    Noob here - my first ever post in a technical forum, be gentle. :-)

    I am working with "hand me down" Spreadsheets of customer contact data that is ill-formatted for importation into a CRM database. The current format has all contacts being located in column A, the number of rows per contact varies from 9 to 12. I would like to break out each of the rows into a different column to which I can apply an appropriate format for importation once the data is categorized into those columns. Here is snapshot of what I am dealing with, the asterisks are in place to protect privacy:

    Name:  Capture.jpg
Views: 260
Size:  23.6 KB

    The text to column feature does not work for me because of inconsistencies in delimiting values that I may use. Inserting delimiters into each row is not realistic because there area few thousand contacts across multiple pages and workbooks.

    I have a very basic knowledge of using VBA to manipulate Excel data and believe I am OK in that regard. I am wondering if anyone has a code to share? Other suggestions as to how I may achieve this goal are welcome. Thank you.

  2. #2
    PowerPoster
    Join Date
    Oct 2008
    Location
    Midwest Region, United States
    Posts
    3,574

    Re: [Excel 2016] Using VBA to Split Colums

    To begin with, tell us what defines the start and the end of "records."

  3. #3
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: [Excel 2016] Using VBA to Split Colums

    i would do a find on "Full Name:" the record then appears (from the sample data) to be one row above that to 2 rows above the next, you can the transpose the range into the next empty row from the top, spaces being left by each previous record being transposed, (the first being transposed to the same top row)
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

Posting Permissions

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



Click Here to Expand Forum to Full Width