+ Reply to Thread
Results 1 to 12 of 12

rearrange specific data on spreadsheet to match the rest of the spreadsheet. Is it possibl

  1. #1
    Registered User
    Join Date
    10-01-2014
    Location
    Tx
    MS-Off Ver
    2013
    Posts
    50

    rearrange specific data on spreadsheet to match the rest of the spreadsheet. Is it possibl

    I am having a hard time knowing how to explain what I need to do but here it goes...I receive a spreadsheet every week in which the data is always in a different order and varying lengths as they just copy and paste the data from different sources. I need the columns to match up so I can sort the data properly. Is there a way to rearrange the data in certain parts of the spreadsheet(never know where or how much) that follow certain conditions to match the other data? I have attached a shortened version of the file and added a sheet that will hopefully help explain what it is I need. Is this at all possible?

    62920 _ WE 09-25-2014.xlsx
    baby_kay_2003

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,944

    Re: rearrange specific data on spreadsheet to match the rest of the spreadsheet. Is it pos

    Looking at your data, it seems that the 1st table on each sheet is identical?

    Do you get sent the tables in row 33-downwards, or is that something you are extracting? It appears that they are the same on each sheet, except the heading sequence is different?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    10-01-2014
    Location
    Tx
    MS-Off Ver
    2013
    Posts
    50

    Re: rearrange specific data on spreadsheet to match the rest of the spreadsheet. Is it pos

    The first sheet is a shortened version of what I get. The second sheet is what I need it to look like. Same data as the first but rearranged to match the 1st table. basically I need certain columns to match up on the different tables at least the cost center, tech number (dvok87548...), and amount.

  4. #4
    Forum Contributor
    Join Date
    08-17-2013
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    132

    Re: rearrange specific data on spreadsheet to match the rest of the spreadsheet. Is it pos

    Hi,
    If i understood you correctly then you just want to rearrange the column from tables starting from row 32 in sheet "WE 09-25-14" and they should look like tables in sheet2 starting from row 32.

    Regards,

  5. #5
    Registered User
    Join Date
    10-01-2014
    Location
    Tx
    MS-Off Ver
    2013
    Posts
    50

    Re: rearrange specific data on spreadsheet to match the rest of the spreadsheet. Is it pos

    Yes BS Singh that is correct for this shortened version of my file but I never know where the data will start. I would assume that the macro will need to somehow find the other tables and then rearrange them.

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,944

    Re: rearrange specific data on spreadsheet to match the rest of the spreadsheet. Is it pos

    So you get a dump of all 6 tables, just like on sheet1? (longer though)

    Im thinking something like this would be the basis of what you want...
    =INDEX('WE 09-25-14'!$A$33:$M$39,ROW(A1),MATCH(Sheet2!A$32,'WE 09-25-14'!$A$32:$M$32,0))

  7. #7
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: rearrange specific data on spreadsheet to match the rest of the spreadsheet. Is it pos

    Hello baby_kay_2003,

    This is quite a challenge. The macro below works on the first tables below the main one. I need to work on an algorithm to for added columns when needed as evidenced in the 5th table.

    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  8. #8
    Registered User
    Join Date
    10-01-2014
    Location
    Tx
    MS-Off Ver
    2013
    Posts
    50

    Re: rearrange specific data on spreadsheet to match the rest of the spreadsheet. Is it pos

    Thanks for working on this for me! I am getting error "object variable or with block variable not set". Highlighting
    Please Login or Register  to view this content.

  9. #9
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,944

    Re: rearrange specific data on spreadsheet to match the rest of the spreadsheet. Is it pos

    did you try my suggestion in post #6?

  10. #10
    Registered User
    Join Date
    10-01-2014
    Location
    Tx
    MS-Off Ver
    2013
    Posts
    50

    Re: rearrange specific data on spreadsheet to match the rest of the spreadsheet. Is it pos

    FDibbins I did try but could not figure out how exactly to use it. I am very new to vba and still trying to learn. I did try to research but couldn't wrap my head around what I needed to do.

  11. #11
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: rearrange specific data on spreadsheet to match the rest of the spreadsheet. Is it pos

    Hello baby_kay_2003,

    Did you run this macro on the workbook you posted or your actual data?

    Here is the workbook you posted with the macro I wrote added to it. This does work - no errors - but the last table is not aligned properly.
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    10-01-2014
    Location
    Tx
    MS-Off Ver
    2013
    Posts
    50

    Re: rearrange specific data on spreadsheet to match the rest of the spreadsheet. Is it pos

    I was running it on my actual data. I used it on the workbook i put here and it worked no errors. /i think it has to be attached to the specific workbook not my personal.

+ 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] Using macro to rearrange dated data from large spreadsheet using find loop (maybe?)
    By danb1985 in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 02-03-2014, 01:44 AM
  2. Match data in one spreadsheet based on 2 conditions in another spreadsheet
    By dfarrel7 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-19-2012, 06:12 AM
  3. Advanced Macro to rearrange data in spreadsheet
    By njp353 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-06-2011, 05:43 PM
  4. Replies: 4
    Last Post: 02-27-2011, 03:58 PM
  5. Replies: 1
    Last Post: 07-30-2010, 10:01 PM

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