Disable Cell formatting pop up Dialog

fraz627

Board Regular
Joined
Apr 26, 2014
Messages
118
Office Version
  1. 2010
Platform
  1. Windows
How do I prevent the Cell formatting dialog from popping up when I right click on a cell?
Thanks
 
This will cancel the right click but you will lose all the options on the context menu.
VBA Code:
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
Cancel = True
End Sub
You will lose all of this on whatever sheet that code is on. Ctl+1 might be the way to go if you need to format cells in that case.

1741366599077.png
 
Upvote 0
hello
you can block only the formatting submenu if you want
VBA Code:
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
    Cancel = True
    With CommandBars("cell")
        .Controls(16).Enabled = False
        .ShowPopup
        .Reset
    End With
End Sub
1741371133868.png

you can make it work on a specific cell range too

Code:
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
    If Target.Column = 2 Then
        Cancel = True
        With CommandBars("cell")
            .Controls(16).Enabled = False
            .ShowPopup
            .Reset
        End With
    Else
        Cancel = False
    End If
End Sub

enjoys
patrick
 
Upvote 0

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