Selection Change Event

P

pwz

I have added an Selection Change Event in my workbook. However, problem is
found when I perform copy and paste. The data is "lost" (the "Paste" is in
light grey) after I has right clicked another cell. Any solution for this?
Thanks in advance for any help!

Pat
 
P

pwz

Here it is:

Private Sub App_SheetCalculate(ByVal Sh As Object)
If Sh.AutoFilterMode Then macroA
End Sub


Post the code for the selection change.
 
P

pwz

It should be this one:

Private Sub App_SheetSelectionChange(ByVal Sh As Object, _
ByVal Target As Excel.Range)
If Sh.AutoFilterMode Then MacroA

End Sub
Post the code for the selection change.
 
P

pwz

Here it is:

Private Sub App_SheetSelectionChange(ByVal Sh As Object, _
ByVal Target As Excel.Range)
If Sh.AutoFilterMode Then MacroA

Thanks!


You may want to post your selectionchange code.
 
P

pwz

Here it is:

Private Sub App_SheetSelectionChange(ByVal Sh As Object, _
ByVal Target As Excel.Range)
If Sh.AutoFilterMode Then MacroA (to change a cell content)

Thanks!


You may want to post your selectionchange code.
 
J

JLGWhiz

It appears that you are trying to run a workbook defined event from the
application level. I am not familiar with that technique, and am not sure
that Excel accepts that as valid event code for the SheetSelectionChange
event. I would normally write the code as

Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, _
ByVal Target As Excel.Range)
If Sh.AutoFilterMode Then MacroA (to change a cell content)
 
J

JLGWhiz

Also, the code must be in the ThisWorkbook code module for it to execute
properly on event.
 

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