Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 3 of 3

Thread: Macro, copying last column to the one after it

  1. #1
    New Member
    Join Date
    Mar 2002
    Location
    Norway
    Posts
    6
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hey
    I'm trying to create macro which goes to the last column that has data in it, copying it to the one after that.

    eg: I have a couple of values in column C. I want to copy this, by using a macro, to column D. Then, the next time I run the macro I want it to copy the values in column D to column E... and so on.

    I know my explanation is bad, but I hope you'll understand.

    Cheers
    Fro

  2. #2
    MrExcel MVP Barrie Davidson's Avatar
    Join Date
    Feb 2002
    Location
    Winnipeg
    Posts
    2,330
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Assuming you have data in all the columns in row 1, you can use:

    Dim LastColumn As Integer

    LastColumn = Range("A1").End(xlToRight).Column
    Columns(LastColumn).Copy _
    Destination:= _
    Columns(LastColumn + 1)

    Regards,
    Barrie Davidson

    "You're only given a little spark of madness. You mustn't lose it." - Robin Williams

  3. #3
    New Member
    Join Date
    Mar 2002
    Location
    Norway
    Posts
    6
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Great!
    It works nicely, now I can finally create a fully automatic updating system for a page ranking the world's best Super Monkey Ball players

    Thank's a lot!

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •