+ Reply to Thread
Results 1 to 7 of 7

Rearranging data with VBA

  1. #1
    Registered User
    Join Date
    07-03-2012
    Location
    Norge
    MS-Off Ver
    Excel 2010
    Posts
    40

    Rearranging data with VBA

    Hi everyone,

    I have some data like this in the SOURCE sheet:

    ASGN CRANE MSG TIME
    19069621 11 ARQ 14:35:41
    19069621 11 ACP 14:36:32
    19069621 11 ARQ 14:36:32
    19069621 11 ACP 14:37:17

    I would like to turn the data into the following form in the DESTINATION sheet.
    The important thing is that the time stamps are dealt with in the correct chronological order.

    ASGN CRANE ARQ1 ACP1 ARQ2 ACP2
    19069621 11 14:35:41 14:36:32 14:36:32 14:37:17

    Please see the attached file for some example data.
    140424_ForumDemo.xlsx

    I will be very grateful for any help with this.

    Best regards,
    Knut

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Rearranging data with VBA

    Here is without VBA:
    Attached Files Attached Files

  3. #3
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Rearranging data with VBA

    I saw now there are some duplicated ASGN's with different CRANE.
    Try this:
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    07-03-2012
    Location
    Norge
    MS-Off Ver
    Excel 2010
    Posts
    40

    Re: Rearranging data with VBA

    Hi zbor, and thanks for your suggestion!

    Your kind of wild formulas seems to work well in the file you provided, but when copying the formulas to my main document, I get a #NUM! error for all cells past the range I gave in the example.

    Attached is the complete main file.
    140424_ForumDemo2.xlsx

  5. #5
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Rearranging data with VBA

    Confirm formula (except column B) with ctrl+shift+enter (not just enter)
    A curely brackets {} must appear around your formula (but those brackets can not be entered manually)

  6. #6
    Registered User
    Join Date
    07-03-2012
    Location
    Norge
    MS-Off Ver
    Excel 2010
    Posts
    40

    Re: Rearranging data with VBA

    That solves everything! Thank you so much!

    Where can I find some reference to what ctrl+shift+enter does?

  7. #7
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Rearranging data with VBA

    It's called Array Formula. Try to google for that term. Something like this

+ 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. Rearranging Data
    By slolux in forum Excel General
    Replies: 2
    Last Post: 03-21-2013, 12:28 AM
  2. rearranging data
    By kbka in forum Excel General
    Replies: 6
    Last Post: 10-11-2011, 04:55 PM
  3. Excel 2007 : Rearranging data
    By gunner in forum Excel General
    Replies: 4
    Last Post: 10-12-2010, 10:12 AM
  4. Rearranging data
    By BFee in forum Excel General
    Replies: 2
    Last Post: 07-28-2010, 01:53 AM
  5. Rearranging Data
    By Meelissa in forum Excel General
    Replies: 2
    Last Post: 05-22-2008, 11:40 PM

Tags for this Thread

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