+ Reply to Thread
Results 1 to 3 of 3

Macro to Reverse Order of Columns but Dependent on Number of Data Rows

  1. #1
    Registered User
    Join Date
    07-09-2012
    Location
    Houston
    MS-Off Ver
    Excel 2010
    Posts
    2

    Macro to Reverse Order of Columns but Dependent on Number of Data Rows

    I am in need of a macro that essentially reverses the order of a set of columns and changes their formats to a couple specific formats (ex: ##+##.## and ##.##'). I am trying to eliminate manual input into excel to get the correct data I can import to Autocad. My data comes in the format of three columns (C,D,E). The problem is the data varies and can fill 20 rows or it can fill 120 rows, etc. I need the macro to be able to accomodate manipulating the data despite the amount of rows which is my main problem.

    I'm attaching two sheets. One has the first macro ran which is a set of formulas I created to get the data I need. The formulas start at column P because in normals circumstances, I have various other info up to column O, but I don't utilize this.
    The first macro I created works fine except it doesn't account for variable row lengths (which I need it to).
    The second sheet I'm attaching shows the end result of what I need. I attempted to make a macro, but it doesn't seem to work correctly. There may be a much easier way to reverse column orders, but to my knowledge, this is the only way I know.

    Any help would be greatly appreciated. And if any other information is needed, I'll be glad to provide it.
    Workbook First Macro Ran.xlsmWorkbook Second Macro Ran.xlsm
    Last edited by francois28; 07-09-2012 at 05:58 PM.

  2. #2
    Registered User
    Join Date
    07-09-2012
    Location
    Houston
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Macro to Reverse Order of Columns but Dependent on Number of Data Rows

    I just wanted to update this in case anyone else comes searching for a solution similar to mine. I have a little background in java and found that you can use loops an other programming language in macros. I'm not familiar with the syntax, but with some searching I was able to come up with a solution. Although it may be kind of crude, it gets the job done.

    Please Login or Register  to view this content.

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    49,030

    Re: Macro to Reverse Order of Columns but Dependent on Number of Data Rows

    So, have you solved your own question or do you still need help? If it is answered, please mark as Solved.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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