A counter and copy column problem

andy-s

Board Regular
Joined
Mar 22, 2002
Messages
51
I've some problem making a macro that will copy the information in Column B to Column C the first time, then from Column B to Column D the next time and so on.

I do know how to make the macro working by using a the Range and Cells command like:

Counter = Sheets("Sheet1").Cells(1, 1)
Range("B1:B6000").Select
Selection.Copy
Cells(1, Counter + 1).Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False

BUT since the excel file grows by roughly 1MB each time I run the macro, I can not use it. The strange part is that the file only grows by a few bytes when I mark Column B and use the copy/paste function to Column C, D, E etc.

So, in order to save place I'm looking for a macro that can copy column. Can you help me?

andy-s
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Counter = Sheets("Sheet1").Cells(1, 1)
Sheets("Sheet1").Columns("B:B").Copy
Sheets("Sheet1").Columns(Counter + 1).PasteSpecial Paste:=xlValues, _
Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False

Try the above inplace of your original code...

Tom
This message was edited by TsTom on 2002-04-21 13:55
 
Upvote 0

Forum statistics

Threads
1,215,069
Messages
6,122,959
Members
449,096
Latest member
Anshu121

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top