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

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.

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,270
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,127,382
Messages
5,624,367
Members
416,025
Latest member
VN5968

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