My problem is that I want to right click a cell using MACRO.
Does MACRO have codes corresponding to this?
You can use the following under a sheet module if you want right click to only work for specific targets (targets being a specific selection of cells)...
Otherwise, just remove the If statements and use the call, or just put ur code directly under the private sub.
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean) If Target = ***insert here the target range you want*** Then Call YOURRIGHTCLICKMACRO End If End Sub
'This code can be stored either under the sheet, or in any other code module
Sub YOURRIGHTCLICKMACRO() msgbox "you click right click" End Sub
*EDIT*
After re-reading your post I think I misunderstood you... What you're saying is you want the right-click edit menu to pop up on a macro command?
You can use a macro to call the "edit" commandbarpopup whenever you execute your macro.
Let me know if that's what you want and I can supply the code.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks