+ Reply to Thread
Results 1 to 2 of 2

Macro to do same series of commands but dynamically

  1. #1
    Registered User
    Join Date
    12-21-2020
    Location
    Orange County
    MS-Off Ver
    California
    Posts
    3

    Macro to do same series of commands but dynamically

    Okay so this should be easy for someone who knows the commands. What I have is this:

    A long list of data all of which is 26 rows long then repeats another series. What I am trying to do is copy 25 rows starting with the second row and transposing that to the first row, column B.

    So what I have is Name1, then 25 rows of data under that, and then Name2 and 25 rows of data under that and so on through Row 1586--soe through "Name61" with 25 rows of data under each name

    So for example starting at Cell A1, Name1. Then from A2 to A26 are the first 25 rows of data. I want to copy what's in A2 to A26 and transpose it starting with Cell B1 so that data will then extend from B1 to Z1.

    Next, I want to delete rows A2 to A26. This will move the next series of data to Cells A2 to A27 and repeat the process but this time I want "Name2" in A2 and the 25 rows of data and the transpose the 25 rows of data to Cells B2 to Z2 and so on.

    So when its done I should have 61 rows (Name1 through Name 61) each with 25 adjacent columns of data.

    So when I try to write a macro OF COURSE the macros uses static ranges and I need it to be dynamic. This can be done with a macro that does the whole thing at once OR does one set of data and I have to run it 61 times obviously all at once is preferable.

    I have attached the file--essentially these are the coaches rankings for the College Football playoffs each coach ranking teams 1 through 25. I attached a second copy with the first two rows done to see how it should be done. And preferably I would like the columns to be only a bit larger than the largest item in that column.

    Chris.
    Attached Files Attached Files
    Last edited by ccmulder; 12-21-2020 at 06:40 PM.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Macro to do same series of commands but dynamically

    Please Login or Register  to view this content.
    Last edited by AlphaFrog; 12-21-2020 at 10:13 PM.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

+ 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] Four series Chart Range Define through VBA dynamically
    By analystbank in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-17-2020, 07:43 AM
  2. Need Macro to open command prompt and use some series of commands
    By balajinatarajan in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 06-21-2016, 03:39 AM
  3. [SOLVED] Open one command window and execute a series of commands from it.
    By Air_Cooled_Nut in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-03-2014, 11:48 AM
  4. Macro Recording Chart Format commands missing all important commands!!!!
    By nounours in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-05-2013, 09:20 PM
  5. Dynamically add series from unsorted data in XY scatter
    By ctosborne89 in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 10-31-2012, 11:32 AM
  6. Chart: add series dynamically (no macro)
    By davidebed in forum Excel General
    Replies: 3
    Last Post: 11-12-2010, 10:26 AM
  7. Dynamically changing the series of chart
    By bhokalivarun in forum Excel Charting & Pivots
    Replies: 5
    Last Post: 06-25-2009, 04:02 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