Posted by Kevin James on May 26, 2001 2:57 PM
Well, I'm now on page 165 of the "Excel2000 Programming for Dummies" book. The following code is presented, *minus* the commented lines:
Private Sub WorkSheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
' If IsEmpty(Target) Then GoTo Out
If IsNumeric(Target) Then
Cancel = True
The problem is, when I right-click on an empty cell, I still get the number format pane. Hence, after fooling with the syntax, trying IsNull and others, I made a intellectual guess, adding the two (currently disabled) commented lines, which makes the code work correctly--that is, not presenting the format pane on empty cells.
Being new, I wondering if this is just a fluke of Excel2000 or if any one of you also experience the same problem.
The author (famed John Walkenbach) also had something else in the SUB statement that doesn't automatically appear when I choose the BeforeRightClick event. His book had:
.... (ByVal Target As Excel.Range ....)
My prepopulated syntax excludes the word "Excel" in the above statement. I tried it both ways and it seems to work either way. Another carryover from an older version???
PS: Hope you all are having a wonderful weekend. I'm cuddled up with allergy pills and Kleenex Cold Care. My wife is doing a TupperWare party.