Sandy Mann said:
from the formula bar. Also it seems to work just as well if I comment out
the IF and End If lines and just leave the:
OldCell.Interior.ColorIndex = xlColorIndexNone
Ah! there is a reason for those lines! I tried recording a Macro of copying
from the Formula Bar and got only:
Sub Macro1()
'
' Macro1 Macro
' Macro recorded 12/12/2005 by Sandy Mann
'
'
Range("H8").Select
ActiveSheet.Paste
End Su
If I then select a cell and copy it, (not from the Formula Bar this time,)
and run the Macro it fails with
Error 1004 "Paste method of worksheet class failed" and highlights the
"ActiveSheet.Paste" line in Macro1, presumably because there is nothing to
paste.
OK all very logical but now if I Debug and End to exit from VBA, every time
I select a new cell I get a Runtime error 91 "Object variable of worksheet
class failed" and it highlights the "OldCell.Interior.ColorIndex =
xlColorIndexNone" line in the Event Macro and continues to do so until I
remove apostrophes from the commented out lines.
mmmmm...... there's more to this VBA than meets the eye <g>