View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.misc
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default change default font color for editing/review

Do you mean so's you can toggle the firing on/off as you choose?

I'm sure one of the brighter lights will have a better solution but my
limited-knowledge proposal would be to create a command button from the Control
Toolbox and have it toggle the events on/off.


Application.EnableEvents = False = Not _
Application.EnableEvents = False


When you create the button, right-click and "View Code"

Your sheet module will open and you can paste the above between these two lines.

Private Sub CommandButton1_Click()
'paste here
End Sub

NOTE: this will affect all application events.

I don't know how to turn it off for just one sheet.


Gord

On Fri, 27 Jul 2007 12:14:04 -0700, AJB wrote:

Thanks- that is very helpful. How would I turn that feature on and off
without doing the whole cut and paste process?

"Gord Dibben" wrote:

Any cell or a particular range of cells?

You could use worksheet event code that would turn the font red as you entered
something.

As written the code below acts upon any cell into which you enter something.

Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo ws_exit:
Application.EnableEvents = False
With Target
If .Value < "" Then
.Font.ColorIndex = 3
End If
End With
ws_exit:
Application.EnableEvents = True
End Sub

This is sheet event code. Right-click on the sheet tab and "View Code"

Copy/paste into that sheet module.


Gord Dibben MS Excel MVP


On Fri, 27 Jul 2007 10:30:03 -0700, AJB wrote:

My question may have been unclear. I want to avoid have to change the font
for each edited cell to red separately. The desired outcome is being able to
click any cell, and what you write is in red without having to manually
switch from the default, black.



"Bob I" wrote:

Your "macro" will need to "Format" the selected cell to "Red Font"

AJB wrote:

I want to be able to write a macro to make red the default font color upon
command to be able to clearly see edits & changes, but I can't seem to be
able to do it. Clicking on Tools/Options/Colors doesn't change my font
color. I want to be able to click in any cell, write, and have it be red.
Any suggestions? Thanks.