View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default IDENTIFY CELLS WHERE FORMULA WAS OVER-RIDDEN

P ut a break point in th eVBA window on the first line and then step through
the code.

On the first with statement highligh and press F9 - It should turn yellow.

return to your workbook sheet and perform a change to acrtivate macro.

the press F8 to sttep through code.

"pmanoloff" wrote:

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