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