With right mouse button, copy locked cells from specific area and paste into another workbook or sheet

Nikko

Board Regular
Joined
Nov 26, 2018
Messages
73
Hello everyone,


With the right mouse button, would like to copy the locked cells in the area "R4: R18" and paste them into another workbook and worksheet.
Folder and sheet is password protected with VBA, cells are locked and hidden in cell formatting.

How can I do this?

… at the same time want to keep the other options with the right mouse button.

VBA Code:
Private Sub Worksheet_BeforeRightClick(ByVal Target As Excel.Range, Cancel As Boolean)
ActiveWorkbook.Sheets("Menu").Unprotect ("1234")
   
    If Not Intersect(Target, Range("G4:G18")) Is Nothing Then
        Target = IIf(Target = "", "A", "")
        Cancel = True
    End If
    
     If Not Intersect(Target, Range("I4:I18")) Is Nothing Then
        Target = IIf(Target = "", "X", "")
        Cancel = True
    End If
    
    If Not Intersect(Target, Range("B7:B7")) Is Nothing Then
        Cancel = True
        TimeScale.Show
    End If
    
  If Not Intersect(Range("R4:R18"), Target) Is Nothing Then
  ????????????????????????????????
????????????????????????????????? VBA code ?
????????????????????????????????
       End If
        
   ActiveWorkbook.Sheets("Menu").Protect ("1234")
    
End Sub

Any help is welcome

Thx in Advance

Nikko
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.

Forum statistics

Threads
1,215,039
Messages
6,122,799
Members
449,095
Latest member
m_smith_solihull

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