Hi Gord,
I have used the VBA successfully, but after saving the file as xlsm, the next time I open it the script doesn't work. It is still there in Show Code,but any new typing just stays at the default black.
Saving without macros and then pasting back the script works fine of course.
(Opening the xlsm file, I do not get asked about enabling macros).
What am I doing wrong?
Dyfed
Gord Dibben wrote:
Re: Setting default font color
26-Jan-09
See in-line responses.
We all get those days.
Actually it is Visual Basic for Applications......VBA..........that Office
applications employ.
What I posted is VBA event code.
Basically the same as a "macro" but triggered by an event rather than
manually.
If running Excel 2007 you must save the workbook as xlsm..............macro
enabled workbook.
David McRitchie's site has a "getting started" page with links to other
sites.
http://www.mvps.org/dmcritchie/excel/getstarted.htm
Also for events...........
http://www.mvps.org/dmcritchie/excel/event.htm
Ron de Bruin's site for where to put the differing types of VBA
code..................
http://www.rondebruin.nl/code.htm
Gord
Previous Posts In This Thread:
Setting default font color
How can I set the font color. I have worksheets with the standard black
font. It would be handy to change to font color so that any dew data or
overwrites I enter would be in another color. Must be a way to do this, but
I haven't found it.
Appreciate any suggestions.
Dave
Re: Setting default font color
Sorry, forgot to mention
WinXP SP2 Excel (Office)2003
Dave
Hi,What exactly do you mean by dew data?
Hi,
What exactly do you mean by dew data?
Your subject line says you want to change the default font. You can do that
for the current sheet by selecting the whole sheet and picking a font color.
In 2007 you can create a custom Theme with a different default color.
You can also use a change event to change the color of the font anytime a
specific cell(s) are changed. But this requires VBA.
Here is some sample code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim isect As Range
Set isect = Application.Intersect(Target, Range("A1"))
If Not isect Is Nothing Then
'Your code here
End If
End Sub
--
If this helps, please click the Yes button
Cheers,
Shane Devenshire
:
Sorry Shane - let me start overFirst of all, my original message got posted
Sorry Shane - let me start over
First of all, my original message got posted accidentally - 'dew' was a typo
for 'new'
Let's say I have a worksheet full of data, all in black fonts
I would like to type in some updated numbers, but I would like them to be
entered in some other color just so I can see what has changed.
I do not want to change all the existing data on the page, just the changed
data, as I type it in
Dave
WinXP SP2 Office(Excel)2003
message
Private Sub Worksheet_Change(ByVal Target As Range) If Target.Cells.
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
On Error GoTo CleanUp
Application.EnableEvents = False
With Target
If .Value <> "" Then
.Font.ColorIndex = 3
End If
End With
CleanUp:
Application.EnableEvents = True
End Sub
Right-click the sheet tab and "View Code". Copy/paste into that module.
Alt + q to return to the Excel window.
Any new entries or edited entries will be in red font.
Gord Dibben MS Excel MVP
Thank you Gord -Unfortunately, I have no idea what you are suggestion -Let's
Thank you Gord -
Unfortunately, I have no idea what you are suggestion -
Let's all forget the whole thing.. Next time I see Bill Gates I'll mention
it
Dave
"Gord Dibben" <gorddibbATshawDOTca> wrote in message
Don't give up yet<g>Did you read my instructions about where to place the code?
Don't give up yet<g>
Did you read my instructions about where to place the code?
A "sheet tab" is the tab at bottom with the sheet name on it, like Sheet1,
Sheet2 etc.
Right-click is using the right-hand mouse button and clicking on the sheet
tab you want the code to run in.
Copy is to select and copy the code text from my post including and between
these two lines
Private Sub Worksheet_Change(ByVal Target As Range)
End Sub
Paste is to paste into the code window that opens when you select "View
Code"
Alt + q is to hold the Alt key and hit "q" on the keyboard.
Gord
Re: Setting default font color
Gord -
Talked to Bill Gates - said to talk to you instead, he was busy
Basic.
etc, The Visual Basic thing never demonstrated anything resembling logic, at
least to me. Probably puts me in the minority. I am comfortable with
Macros, just not VB I guess.
Tried all the way down to 'Low' - no joy
Guess it's time :-(
while I'm at it.
Everything much appreciated
Your humble servant (like you need me)
Dave
"Gord Dibben" <gorddibbATshawDOTca> wrote in message
Re: Setting default font color
See in-line responses.
We all get those days.
Actually it is Visual Basic for Applications......VBA..........that Office
applications employ.
What I posted is VBA event code.
Basically the same as a "macro" but triggered by an event rather than
manually.
If running Excel 2007 you must save the workbook as xlsm..............macro
enabled workbook.
David McRitchie's site has a "getting started" page with links to other
sites.
http://www.mvps.org/dmcritchie/excel/getstarted.htm
Also for events...........
http://www.mvps.org/dmcritchie/excel/event.htm
Ron de Bruin's site for where to put the differing types of VBA
code..................
http://www.rondebruin.nl/code.htm
Gord
default font color
It's unbelievable that you have to jump through these hoops to do a simple thing like change the default font color.
Submitted via EggHeadCafe - Software Developer Portal of Choice
LINQ With Strings
http://www.eggheadcafe.com/tutorial...47db-adb9-db7fe2c6ab8c/linq-with-strings.aspx