+ Reply to Thread
Results 1 to 3 of 3

Reverse columns using VBA

  1. #1
    Registered User
    Join Date
    08-05-2013
    Location
    Romania
    MS-Off Ver
    Excel 2010
    Posts
    7

    Reverse columns using VBA

    Hello to everybody,

    As told you at my first post, I'm still learning VBA :-)
    Now I'm working on a sheet in which I import some data. Actually I will monthly import some figures, so in the end of the year I will have 12 columns.
    In each month the txt file will contain the actual month and the month back until January.

    The problem is that my txt file contains the month reversed. It starts all the time with the actual month and ends with January.

    To use this sheet in my file I will need to reverse the order, so the first column will be January. Now I found this code:
    Please Login or Register  to view this content.
    It does the job but only in case if I have a full year. If I import data for 5 month January it will be 6th column, and the first 6 are filled in with 0 values.

    I would need your support to find a solution to this code so in any case January will be in the first row.

    Thanks a lot!
    Last edited by AliGW; 07-23-2018 at 03:52 AM.

  2. #2
    Registered User
    Join Date
    08-05-2013
    Location
    Romania
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Reverse columns using VBA

    Hello all,

    I managed to solve the problem with the following code:
    Please Login or Register  to view this content.

  3. #3
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: Reverse columns using VBA

    Just change first two lines to this :
    Please Login or Register  to view this content.
    1. I care dog
    2. I am a loop maniac
    3. Forum rules link : Click here
    3.33. Don't forget to mark the thread as solved, this is important

+ 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. How to revers this Macro to Pull Data from closed workbook with ADO.Connection
    By nordicdust in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-19-2018, 04:06 PM
  2. Replies: 5
    Last Post: 10-06-2017, 03:59 PM
  3. Replies: 4
    Last Post: 08-20-2017, 06:40 PM
  4. Macro to Copy from 2 Columns, Paste Value in the next 2 Columns, Then clear 1st Columns
    By MHALTTUNEN in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-22-2014, 03:34 PM
  5. Combining multiple rows from 2 columns into sorted columns depending on 1st columns value
    By Dexamphetamine in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-11-2013, 10:00 AM
  6. Replies: 6
    Last Post: 04-11-2013, 11:27 AM
  7. [SOLVED] Looking for function or formula to calculate number that is revers
    By Ken in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-07-2005, 08:06 AM

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