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...
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.

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,344
Office Version
  1. 365
Platform
  1. Windows
Why not just insert a column?

Wouldn't that have the same effect?
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,164,626
Messages
5,838,430
Members
430,547
Latest member
jopshio

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