(Ctrl + V) Vs. [right click > paste]

larrythestag

New Member
Joined
Jul 30, 2009
Messages
5
Hello All,

In the below VBA I use the Worksheet_Change event to startup. Everything works great until someone copies and paste using the right click. The issue is if someone Copies the value A13 and Pastes it in range (A13:A30). It seems to lock up if you use [right click > paste]. However, If you use (Ctrl + V) or any other method of copy and paste it works fine.

I am hoping someone can lend a hand on this one.

Thanks

Larry
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Application.ScreenUpdating = False
Dim rng As Range
Dim test As String
Dim TopRow_Selection As Long
Dim BottomRow_Selection As Long
Dim TopLeftCel_Selection As String, BottomLeftCel_Selection As String, TopRightCel_Selection As String, BottomRightCel_Selection As String
 
    Col = Target.Column
    ro = Target.Row
 
With Selection
    TopRow_Selection = .Row
    BottomRow_Selection = .Rows.Count + .Row - 1
 
    If TopRow_Selection <> BottomRow_Selection Then
        Application.EnableEvents = False
    End If
 
For x = TopRow_Selection To BottomRow_Selection
    If Target(1, 1).Column = 1 Then
        ThisRow = x
 
 
    Range("A" & x).Select
     Select Case Range("A" & x).Value
            Case "Select"
                Range("B" & ThisRow & ":K" & ThisRow).Select
                'Range("B13:I13").Select
                Selection.Interior.Pattern = xlSolid
                Range("A" & ThisRow).Select
 
 
            Case "Add New"
                Range("B" & ThisRow & ":K" & ThisRow).Select
                'Range("B13:I13").Select
                Selection.Interior.Pattern = xlSolid
                Range("H" & ThisRow).Interior.Pattern = xlCrissCross
 
                Range("A" & ThisRow).Select
 
 
            Case "Job/Function Change"
                Range("B" & ThisRow & ":K" & ThisRow).Select
                Selection.Interior.Pattern = xlSolid
                Range("D" & ThisRow & ":J" & ThisRow).Select
                'Range("D13:I13").Select
                Selection.Interior.Pattern = xlCrissCross
                Range("A" & ThisRow).Select
 
            Case "Leaving Department"
                Range("B" & ThisRow & ":K" & ThisRow).Select
                Selection.Interior.Pattern = xlSolid
                Range("D" & ThisRow & ":K" & ThisRow).Select
                'Range("D13:I13").Select
                Selection.Interior.Pattern = xlCrissCross
 
                Range("A" & ThisRow).Select
 
                Case "Termination"
                Range("B" & ThisRow & ":K" & ThisRow).Select
                Selection.Interior.Pattern = xlSolid
                Range("D" & ThisRow & ":K" & ThisRow).Select
                'Range("D13:I13").Select
                Selection.Interior.Pattern = xlCrissCross
                Range("A" & ThisRow).Select
 
            Case "Transfer (Manager Change)"
                Range("B" & ThisRow & ":K" & ThisRow).Select
                Selection.Interior.Pattern = xlSolid
                    Range("D" & ThisRow & ":G" & ThisRow).Select
                    'Range("D13:G13").Select
                    Selection.Interior.Pattern = xlCrissCross
                    Range("J" & ThisRow & ":K" & ThisRow).Select
                    'Range("D13:G13").Select
                    Selection.Interior.Pattern = xlCrissCross
                Range("A" & ThisRow).Select
 
            'Case "Name Change"
             '   Range("B" & ThisRow & ":I" & ThisRow).Select
              '  Selection.Interior.Pattern = xlSolid
               ' Range("A" & ThisRow).Select
    End Select
 
Else: End If
Next
End With
Application.EnableEvents = True
End Sub
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.

Forum statistics

Threads
1,216,192
Messages
6,129,440
Members
449,509
Latest member
ajbooisen

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