electronictokwa
Board Regular
- Joined
- Oct 25, 2011
- Messages
- 122
I have been working on this for a couple of days now. Two sheets (Main and VCards); based on what is clicked on the Main sheet, a named range will be copied and should be pasted on range D:J on the Main sheet. Here is my code so far:
Const iTocCOl As Integer = 2
Const NVIDIA_Quadro_2000Row As Integer = 3
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Application.ScreenUpdating = False
Dim iRow As Integer
iRow = ActiveCell.Row
If Not ActiveCell.Column = iTocCOl Then
Exit Sub
End If
Select Case iRow
Case NVIDIA_Quadro_2000Row
Columns("D:J").Clear
Application.Goto reference:="Quadro_2000"
GoTo Paste
Case Else
Exit Sub
End Select
Paste:
Selection.Copy
Range("A1:D50").Select
ActiveCell.PasteSpecial xlPasteAll
Application.CutCopyMode = False
End Sub
There is the error Select Method of Range Class Failed line Range("A1:D50").Select. Thanks in advance for any ideas!
Const iTocCOl As Integer = 2
Const NVIDIA_Quadro_2000Row As Integer = 3
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Application.ScreenUpdating = False
Dim iRow As Integer
iRow = ActiveCell.Row
If Not ActiveCell.Column = iTocCOl Then
Exit Sub
End If
Select Case iRow
Case NVIDIA_Quadro_2000Row
Columns("D:J").Clear
Application.Goto reference:="Quadro_2000"
GoTo Paste
Case Else
Exit Sub
End Select
Paste:
Selection.Copy
Range("A1:D50").Select
ActiveCell.PasteSpecial xlPasteAll
Application.CutCopyMode = False
End Sub
There is the error Select Method of Range Class Failed line Range("A1:D50").Select. Thanks in advance for any ideas!