Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copy Excel column in VB6

Status
Not open for further replies.

IFRs

Programmer
Mar 28, 2003
327
US
I'm writing a Visual Basic program that accesses existing Excell files. I need to select an entire column and then insert the entire column, shifting all columns to the right. Excell's macro recorder shows:

Worksheets(1).Columns("C:C").Select
Worksheets(1).Selection.Copy
Worksheets(1).Selection.Insert Shift:=xlToRight

But, VB6 only likes the first line. This must be a simple question, I hope someone knows the answer!!

Thanks!!
 

Try this

Worksheets(1).Columns("C:C").Select
Selection.Copy
Selection.Insert Shift:=xlToRight
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top