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

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK

Forum statistics

Threads
1,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

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