G
Guest
I am trying to code that when a cell is selected it copies the cell range
N3:Q242 from sheet x to the same cell range on the current sheet. With the
code below, I receive a error:
Run-time error ‘1004’
Select method of Range class failed.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = "$K$1" Then
Sheets("ProgramSummaryTemplate").Select
Range("N3:Q242").Select
Selection.Copy
Sheets("ProgramSummary").Select
Range("N3:Q242").Select
Selection.PasteSpecial
End If
Cancel = True
End Sub
Also, what is the syntax for the target to become the “active†worksheet
instead of being hard coded.
N3:Q242 from sheet x to the same cell range on the current sheet. With the
code below, I receive a error:
Run-time error ‘1004’
Select method of Range class failed.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = "$K$1" Then
Sheets("ProgramSummaryTemplate").Select
Range("N3:Q242").Select
Selection.Copy
Sheets("ProgramSummary").Select
Range("N3:Q242").Select
Selection.PasteSpecial
End If
Cancel = True
End Sub
Also, what is the syntax for the target to become the “active†worksheet
instead of being hard coded.