Firstly, this should take the contents of the clipboard, same them to the dataobject, manipulate the sheet that has just been selected (to ensure that some data that gets hidden elsewhere is actually visible; sets the font colour to white) and then puts the dataobject data back onto the clipboard.
Code:
Private Sub Workbook_SheetActivate(ByVal Sh As Object)
clipdata = GetOffClipboard
wsheet = Sh.Name
If wsheet <> "Agent Details" And wsheet <> "Agent Import" Then
Call show_area(wsheet)
End If
PutOnClipboard (clipdata)
Application.EnableEvents = True
End Sub
(Note that this makes use of the procedures published at
http://www.cpearson.com/excel/clipboar.htm)
OK - that's fine, and all seems to work perfectly; I can copy and paste between sheets. There's no Application.Enablevents statements in sight (apart from the obvious, just-in-case one!) in any of the procedures that get called along the way.
Now, the following code is used to update the worksheet that has just been changed, and to populate further details based on the value that was entered.
Code:
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Call update_worksheet(Target)
End Sub
If I set a breakpoint on the Call statement, I can see the code running to it when I edit a cell directly, or when I paste data
from the same worksheet.
If, however, I copy data from a different worksheet, and paste it into the sheet with the Worksheet_Change event shown above, then it (the event)doesn't get triggered.
The only thing that I can think is causing the problem is the manipulation of the clipboard... but I can't see anything amiss
Help me Obi-Wan Kenobi, you're my only hope
