View Single Post
  #12   Report Post  
Posted to microsoft.public.excel.programming
pmanoloff pmanoloff is offline
external usenet poster
 
Posts: 6
Default IDENTIFY CELLS WHERE FORMULA WAS OVER-RIDDEN

Bob, you are a genius! It works great! Two questions from the result - #1)
if I want to change the color, I assume I just change the number 38 and #2),
once I executed that, the undo button disappeared--any way to keep that?

"Bob Phillips" wrote:

Sorry mate, I gave you the wrong instructions ... my bad.

This is what I should have said.

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"pmanoloff" wrote in message
...
Yes, I right clicked on the excel icon next to the word FILE so it is
stored
in the project window under Microsoft Excel Objects, and is the last item
after my worksheets and it says ThisWorkbook. Do I need to name it and
execute it? I was assuming that since it was event code that it
automatically executed when I opened the workbook.

"Bob Phillips" wrote:

Did you follow my instructions as to where to store that code?

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my
addy)

"pmanoloff" wrote in message
...
Thanks for the quick response. I pasted the code in the VB screen for
ThisWorkbook, and saved the file, tested it and it does not work. Is
there
something else I should do? I'm not well versed in Excel macros--I'm
an
old
Lotus baby. I did have a .net class a while back though.

"Bob Phillips" wrote:

This code will trap changes, and if a formula is over-written, colour
the
cell

Option Explicit

Private fWasFormula As Boolean

Private Sub Worksheet_Change(ByVal Target As Range)

With Target
If .Count = 1 Then
If fWasFormula Then
If Not Target.HasFormula Then
.Interior.ColorIndex = 38
End If
End If
End If
End With

End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
fWasFormula = Target.HasFormula
End Sub




'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my
addy)

"pmanoloff" wrote in message
...
Does anyone know of a way to identify cells where a formula was
keyed
over
with hard text? If not, is there a way to color the boxes a
different
color
or something? Thanks, Pam