Excel 2003 - right click clears selected cells

M

Michelle

We have Excel 2003 SP3 on Windows XP SP2. Recently on one device, when we
select some cells and right click, we don't see the typical menu (copy, cut,
paste, etc.) -- it just clears the selection. Any ideas/suggestions?
Thanks!
 
D

Daniel.C

Can you execute the following macro :
Sub test()
Application.CommandBars("Cell").Reset
End Sub
Daniel
 
G

Gary''s Student

You may be seeing the result of an Event macro. Let's say you wanted to
create this feature: right-click clears the selected cells. Enter the
following event macro in the worksheet code area:

Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As
Boolean)
Cancel = True
Target.Clear
End Sub


This produces what you are seeing: the selected cells get cleared and no
right-click menu appears.


Because it is worksheet code, it is very easy to install and use:

1. right-click the tab name near the bottom of the window
2. select View Code - this brings up a VBE window
3. paste the stuff in and close the VBE window

If you save the workbook, the macro will be saved with it.

To remove the macro:

1. bring up the VBE windows as above
2. clear the code out
3. close the VBE window

To learn more about macros in general, see:

http://www.mvps.org/dmcritchie/excel/getstarted.htm

To learn more about Event Macros (worksheet code), see:

http://www.mvps.org/dmcritchie/excel/event.htm
 
M

Michelle

Hi Gary - thanks for the information. I did come across some information
similar to this when researching before posting ... but I wasn't sure it
applied. The user doesn't recall doing any code and this is happening to
every Excel document he has -- not just one.

Any idea what would cause it to happen without (known) user intervention to
all Excel documents? We did have a different user login to the machine (to
generate a new OS profile with default settings) and the second user didn't
have the issue ... so it must be something specific to the original users
profile/settings...

Thanks!
 
G

Gary''s Student

Valuable information. Have the user

1. quit Excel

2. go to:
C:\Documents and Settings\username\Application Data\Microsoft\Excel
and temporarily remove the .xlb file

3. re-start Excel. If the problem is gone, the .xlb was probably corrupt.
If the problem remains, restore the .xlb file and search elsewhere.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top