Paste Link problem

Azplj

New Member
Joined
May 8, 2014
Messages
16
Hi guys,
I am encountered a problem today while I am using VBA for excel. I was trying to Copy the column(8) and do paste link. Here is the code:

Code:
Sub testStatus()
      Dim name As String
      Dim leftLocation As String    ' initial variables
      
      Columns(8).Select
      Columns(8).Copy                ' select and copy the column
      name = ActiveSheet.name
      Range("insertCol").EntireColumn.Insert   ' insert a blank column and paste the column that select and copy before
      Range("insertCol").Select
      leftLocation = name
      ActiveCell.Offset(0,-1).Value = leftLocation
End Sub

Here is the problem:
"Range("insertCol").EntireColumn.Insert" - this line of code will insert a blank column and paste the column that select and copy before. What should I do to stop the 'paste' step and do that later. Because I want to use "ActiveSheet.Paste Link:=Range" somewhere in the code, by using paste link method to paste the column. Can anybody help me please? Thank you!

Johnny
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Hiya
You need to insert the new column before you copy
HTH
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,915
Members
452,366
Latest member
TePunaBloke

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