+ Reply to Thread
Results 1 to 4 of 4

macro to shift columns in sequence

  1. #1
    Registered User
    Join Date
    05-12-2014
    MS-Off Ver
    Excel 2003
    Posts
    7

    macro to shift columns in sequence

    I have some data that I imported from a text file which I would like to represent as 512 rows by 512 columns.

    After importing the data, it all showed up just fine. The problem is, its giving me columns 1 through 7 with all 512 rows, under which there is a blank row, then column headers 8 through 14 and their respective 512 rows. The pattern repeats in groups of 7 columns, all the way up to 512, giving me a long skinny rectangle where I want a square.

    If there is any way I could shift all these columns to the proper shape without cutting and pasting manually, as I suspect there is, it would save me a considerable amount of work, seeing as I have a dozen or so of these files I need to format.

    Thank you very much in advance, and please let me know if clarification on my issue is needed.

  2. #2
    Valued Forum Contributor Miroslav R.'s Avatar
    Join Date
    05-16-2013
    Location
    NMnV, Slovakia
    MS-Off Ver
    Excel 2007
    Posts
    479

    Re: macro to shift columns in sequence

    Hi there
    Would be great if You upload sample sheet. ;-)

    send from my xperia z via tapatalk
    Regards
    Miroslav R.

    (If You like my solutions, feel free to add reputation.)

  3. #3
    Registered User
    Join Date
    05-12-2014
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: macro to shift columns in sequence

    exposuresample.xlsx

    I hope I attached that correctly.

    The whole file did not fit, but the one I (may or may not have) posted here includes columns 1 through 24 of the 512 in the undesirable format.

    I'd like to shift all the columns so that they are adjacent to one another, with all the values in rows 1 through 512 lined up.

    In other words, I'd like the output of our macro to look like this:

    desiredexposuresample.xlsx

  4. #4
    Valued Forum Contributor Miroslav R.'s Avatar
    Join Date
    05-16-2013
    Location
    NMnV, Slovakia
    MS-Off Ver
    Excel 2007
    Posts
    479

    Re: macro to shift columns in sequence

    exposuresample.xlsm

    Hi there,

    this code did the trick:

    Please Login or Register  to view this content.
    Try it on full size sample and let me know if it is OK...

    So I hope i helps

    Regards

    M

+ 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. Macro to Shift Columns based on Rank Value
    By eemrun in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-03-2013, 07:11 AM
  2. Macro to copy values from columns of one sheet & paste it to diffrnt Column Sequence
    By kmvasudha in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-06-2013, 06:54 AM
  3. Match two columns with macro and shift cells down
    By cheerockracy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-18-2009, 05:58 PM
  4. Need help using columns series or sequence
    By tyler3 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-08-2006, 10:36 AM
  5. shift right 5 columns
    By raymond chiu in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-22-2005, 01:20 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