Copying columns... What am I doing wrong???

jackass209

New Member
Joined
Jul 14, 2007
Messages
49
Trying to copy columns 6 til the last non-blank column and paste it 1 column to the right. This is what I'm trying:

sh3.Columns(6 & ":" & LaatstKol).Copy
sh3.Columns(7 & ":" & LaatstKol + 1).Select
ActiveSheet.Paste

Can someone tell me what I'm doing wrong? Feeling pretty stupid over here...
 

Some videos you may like

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.

pbt

Well-known Member
Joined
Oct 18, 2005
Messages
1,613
First of all change LaatstKol

to LastCol and see what happens

Unless you have declared LaatstKol as something

Harry
 

jackass209

New Member
Joined
Jul 14, 2007
Messages
49
Hi Harry,

Yeah LaatstKol finds the last non-blank Column.
So changing it to LastCol wouldn't make a difference.
Any other advice by any chance?

LaatstKol = sh3.Cells(1, Columns.Count).End(xlToLeft).Column
 

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,274
Office Version
  1. 365
Platform
  1. Windows
Why not just insert a column?

Wouldn't that have the same effect?
 

Watch MrExcel Video

Forum statistics

Threads
1,128,107
Messages
5,628,731
Members
416,333
Latest member
Time2Learn

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
Top