+ Reply to Thread
Results 1 to 6 of 6

Shuffling values into appropriate columns

  1. #1
    Registered User
    Join Date
    12-22-2020
    Location
    Southern CT
    MS-Off Ver
    2007
    Posts
    4

    Shuffling values into appropriate columns

    Hello, I have bunch of data in a worksheet with a header. I need to shuffle the data into appropriate columns without having to paste each value individually. Is there anyway to do that? I found an older threat from 2010 where this was done successfully. I proved it by downloading the sample spreadsheet and macro and running it. However, I could not adjust the syntax for my particular table. The macro only succeeded in mixing up the data.

    As can be seen in the attached sample table, I wish to shuffle the values (1 to 12) into their respective columns (B to M). The full table has 2,400 rows with 4,600 values, hence, the necessity of a macro.

    Thank you for any guidance.
    Attached Files Attached Files

  2. #2
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: Shuffling values into appropriate columns

    If I've understood the request correctly AND your original data looks as I figured, then perhaps this will work?

    Please Login or Register  to view this content.
    BSB

  3. #3
    Registered User
    Join Date
    12-22-2020
    Location
    Southern CT
    MS-Off Ver
    2007
    Posts
    4

    Re: Shuffling values into appropriate columns

    That is IT, sir! Thank you! What amazes me is that the syntax is relatively short, at least compared to the macro I was toying with from another thread.

  4. #4
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: Shuffling values into appropriate columns

    There are often many ways to accomplish the same thing in Excel. Some people write lots of code and some do the opposite. I'm sure if someone put their mind to it they could write a sub even shorter than my example for you.
    I just like to keep it simple and easy to understand.

    Glad it does what you need and happy I could help

    BSB

  5. #5
    Registered User
    Join Date
    12-22-2020
    Location
    Southern CT
    MS-Off Ver
    2007
    Posts
    4

    Re: Shuffling values into appropriate columns

    Thanks again. You kept it simple for sure, but as for ease of understanding, well, it takes a bit of experience with excel syntax, I'm sure. My wife was astonished by it: "You mean you can program for excel?!" She's a biostatistician and programs for SAS, and I have written applescripts for Quark Xpress and OSX. Yet between us, we spent an inordinate amount of time defining each line of the macro above. I think we understand most of it

  6. #6
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: Shuffling values into appropriate columns

    Give me a shout if you need any of it explaining. It's a very straightforward language once you get your head around the syntax.

    BSB

+ 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. Cell's shuffling
    By AlienFromSpace in forum Excel General
    Replies: 1
    Last Post: 06-14-2015, 12:53 PM
  2. Shuffling cells
    By MrBurns in forum Excel General
    Replies: 9
    Last Post: 08-21-2012, 12:32 AM
  3. Shuffling
    By Hell bent in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-15-2012, 08:36 AM
  4. Random shuffling in 3 columns using VBA
    By Lifeseeker in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 11-09-2011, 01:40 PM
  5. Shuffling data
    By CellGL5371 in forum Excel General
    Replies: 1
    Last Post: 03-04-2007, 04:10 PM
  6. Shuffling a List of Values
    By ExcelTip in forum Tips and Tutorials
    Replies: 0
    Last Post: 08-28-2005, 11:27 AM
  7. [SOLVED] Shuffling a Data List
    By Don Lloyd in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-09-2005, 02:06 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