Deactivate Selection in Range of Cells

mef1sto

Board Regular
Joined
Oct 31, 2013
Messages
85
Hello!
I have a range of cells and if i select more than one cell in this range it will reduce my selection to one cell and everything works quite fine until i select for e.g. two cell but the cell right in the vicinity of my range of cells (and this column has a formula) in will select my one cell in the range BUT it will also copy to this cell the formula from the near cell by that selection of two cell i previously had done and i don't know how to avoid this from happening :( Maybe a little help i'd be great!

Code:
'Worksheet_SelectionChange(ByVal Target As Range)
'Disable MULTICELL SELECTION
Set rnga12 = Range("B16:E28")
    For Each cell In rnga12
    
    If Not Intersect(Target, cell) Is Nothing And Target.Count > 1 Then
        Target.Cells(1, 1).Select
    End If
    Next cell
Also in this range i happen to have a rule to not be able to rewrite cells
Code:
' Worksheet_Change(ByVal Target As Range)
Set rnga12 = Range("B16:E28")
    For Each cell In rnga12
    
    If Not Intersect(Target, cell) Is Nothing Then
        If cell.Value = 0 Or cell.Value <> 0 Then
            MsgBox "Update cell denied!", vbCritical
            Application.Undo
        End If
    End If
    Next cell
 
Last edited:

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.

Forum statistics

Threads
1,215,432
Messages
6,124,858
Members
449,194
Latest member
HellScout

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