+ Reply to Thread
Results 1 to 7 of 7

Table transformation

  1. #1
    Registered User
    Join Date
    04-03-2014
    Location
    Paris
    MS-Off Ver
    Excel 2007
    Posts
    4

    Table transformation

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Table transformation

    Maybe the below will help, you will need to adjust to your range of your data.
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    04-03-2014
    Location
    Paris
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Table transformation

    Thank you for your answer!

    I'm not expert on VBA but my rows contain a variable non empty cells! I mean on the first row last column is D but on the second it's "AC".

    Can you please help me on that.

    Thanks

  4. #4
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Table transformation

    Hi, the code is set up to work on any number of columns. However, I had to make assumptions about where the data was located. Perhaps if the code doesn't work, you could upload an example workbook to show what your data looks like and I can alter the code as neccessary. To upload a workbook, click go advanced, and then attachments.

  5. #5
    Registered User
    Join Date
    04-03-2014
    Location
    Paris
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Table transformation

    Ooooh It's working with my data! Thank you ragulduy

  6. #6
    Registered User
    Join Date
    04-03-2014
    Location
    Paris
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Table transformation

    Can you explain me the code when you have time please

  7. #7
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Table transformation

    This bit
    Please Login or Register  to view this content.
    loops through each row, and if there is something in column C, inserts a row, copies down the value of column a and then moves the columns from C to the end of the row to the next row, starting at column B.

    this:
    ActiveSheet.Cells.Sort key1:=Range("A1"), key2:=Range("B1")

    sorts the new data set by column a and then by column b, so that the items are in aphabetical order and the duplicates are next to each other

    This bit:
    Please Login or Register  to view this content.
    loops through each row and if it is a duplicate deletes it, it also checks if the column A entry is not the first one of that item and deletes it if it isn't

+ 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. Data transformation
    By jaZZerkill in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 03-28-2012, 06:56 AM
  2. Table transformation
    By alfieboy in forum Excel General
    Replies: 3
    Last Post: 02-17-2010, 08:09 PM
  3. Time transformation
    By lza in forum Excel General
    Replies: 3
    Last Post: 12-03-2009, 06:44 AM
  4. transformation of data?
    By schallpattern in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 11-02-2008, 10:16 PM
  5. transformation question
    By excelisgreat in forum Excel General
    Replies: 3
    Last Post: 06-14-2008, 04:05 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