![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Mar 2002
Location: Norway
Posts: 6
|
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 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Winnipeg
Posts: 2,330
|
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 |
|
New Member
Join Date: Mar 2002
Location: Norway
Posts: 6
|
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! |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|