+ Reply to Thread
Results 1 to 7 of 7

VBA Split Data

  1. #1
    Forum Contributor
    Join Date
    11-06-2012
    Posts
    139

    VBA Split Data

    In the attachment i made a code which should separate the examples over different columns instead of just column A.

    So i've got a two examples. I want to split the first example in row 1 over different columns, the separation mark is the comma.

    After the first example there is a blank line.

    Example 2 in row 3 over different columns, the separation mark is still the comma.

    But in the code in the attachment (run it), copies just one example. In this case example two
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    11-02-2012
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    564

    Re: VBA Split Data

    After rData.Clear, add another line sFull = ""

  3. #3
    Forum Contributor
    Join Date
    11-06-2012
    Posts
    139

    Re: VBA Split Data

    Thnx.

    This works for two examples, for the first two examples it worked. The third one is a copy of the second one.

    What should i change if i want to change this for more than 100 examples?

  4. #4
    Valued Forum Contributor
    Join Date
    11-02-2012
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    564

    Re: VBA Split Data

    This should work for any number of examples. Can you upload the file that is showing error? CurrentRegion returns the cells that are bounded by any combination of blank rows and blank columns. So make sure that your each example is separated by blank rows in between.

  5. #5
    Forum Contributor
    Join Date
    11-06-2012
    Posts
    139

    Re: VBA Split Data

    Hi,

    Thnx you were right.

    Could you write a vba code for the format is an the attachment?

    So it is like the old sheet and it should be ordered as the new sheet.

    I kept the blank lines in between like the two examples, the same for the rest.
    Attached Files Attached Files

  6. #6
    Valued Forum Contributor
    Join Date
    11-02-2012
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    564

    Re: VBA Split Data

    You don't need blank row for each cell value. Only where the current region ends i.e at the end of each example. To do the format you wanted, do you have same number of rows for each address or will it change?

  7. #7
    Forum Contributor
    Join Date
    11-06-2012
    Posts
    139

    Re: VBA Split Data

    The format is like the one in the example and it for each adress the same.

    I will keep the same number of rows.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Split Array, Listing Marked Items in Split Arrays
    By lesoies in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-27-2013, 02:07 AM
  2. Split data from Master Sheet to existing worksheets and overwrite data
    By vmwest in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-21-2013, 05:36 PM
  3. [SOLVED] Split Macro modification to Split into new Workbooks instead of sheets within one workbook
    By DLSmith in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-13-2012, 08:11 PM
  4. Can excels Split() function split a string up at multiple spots?
    By 111StepsAhead in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-14-2011, 02:36 PM
  5. Extracting data from one massive worksheet to split to smaller sheets of data
    By michaelkwc in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 05-21-2008, 06:35 AM

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