Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default enter number in cell when font color is changed

I would like a number to be automatically entered into a cell as the font
color of that cell is changed to a specific color. Any ideas? I am using
Excel 2003. I appreciate any help!

Suzi
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default enter number in cell when font color is changed

You would need VBA code to do that

Unfortunately event code won't react to a change of color so you would need a
macro which you run manually.


Gord Dibben MS Excel MVP

On Thu, 11 Oct 2007 09:25:02 -0700, Suzi wrote:

I would like a number to be automatically entered into a cell as the font
color of that cell is changed to a specific color. Any ideas? I am using
Excel 2003. I appreciate any help!

Suzi


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default enter number in cell when font color is changed

unfortunately I am too new to Excel to know how to use macros - is how to do
this something you would share with me?

"Gord Dibben" wrote:

You would need VBA code to do that

Unfortunately event code won't react to a change of color so you would need a
macro which you run manually.


Gord Dibben MS Excel MVP

On Thu, 11 Oct 2007 09:25:02 -0700, Suzi wrote:

I would like a number to be automatically entered into a cell as the font
color of that cell is changed to a specific color. Any ideas? I am using
Excel 2003. I appreciate any help!

Suzi



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default enter number in cell when font color is changed

Can be done but do you want a choice of numbers depending upon the color?

Just one particular color and one specific number?

Just one cell or many cells?

First scenario..................

Sub test1()
Dim rng As Range
Set rng = ActiveSheet.Range("A1")
Select Case rng.Font.ColorIndex
Case Is = 3: Num = 1234 'red font
Case Is = 4: Num = 5678 'green
Case Is = 5: Num = 9876 'blue
Case Is = 6: Num = 4321 'yellow
Case Is = 7: Num = 8765 'pink
End Select
rng.Value = Num
End Sub

Second scenario...............

Sub test2()
With ActiveSheet.Range("A1")
If .Font.ColorIndex = 3 Then
.Value = 12345
End If
End With
End Sub

Since you're not familiar with VBA and macros, see David McRitchie's site for
more on "getting started".

http://www.mvps.org/dmcritchie/excel/getstarted.htm

In the meantime..........

First...create a backup copy of your original workbook.

To create a General Module, hit ALT + F11 to open the Visual Basic Editor.

Hit CRTL + r to open Project Explorer.

Find your workbook/project and select it.

Right-click and InsertModule. Paste the code in there. Save the
workbook and hit ALT + Q to return to your workbook.

Run or edit the macro by going to ToolMacroMacros.

You can also assign this macro to a button or a shortcut key combo.

Another method would be a doubleclick or selectionchange event. If interested
post back with more details.


Gord

On Thu, 11 Oct 2007 13:09:03 -0700, Suzi wrote:

unfortunately I am too new to Excel to know how to use macros - is how to do
this something you would share with me?

"Gord Dibben" wrote:

You would need VBA code to do that

Unfortunately event code won't react to a change of color so you would need a
macro which you run manually.


Gord Dibben MS Excel MVP

On Thu, 11 Oct 2007 09:25:02 -0700, Suzi wrote:

I would like a number to be automatically entered into a cell as the font
color of that cell is changed to a specific color. Any ideas? I am using
Excel 2003. I appreciate any help!

Suzi




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I change the color of the cell when someone enter any number or character? Saz New Users to Excel 6 August 14th 07 12:38 PM
How can I change the color of the cell when someone enter any number or character? [email protected] Charts and Charting in Excel 1 August 13th 07 02:47 PM
Font Color Changed DNA Excel Discussion (Misc queries) 2 November 2nd 06 04:36 PM
when i enter time in cell it changed, why? Hassan Excel Worksheet Functions 1 June 9th 06 01:38 AM
How to make the cell or font color red if the number is negative? Bob T Excel Worksheet Functions 6 August 18th 05 01:28 PM


All times are GMT +1. The time now is 01:10 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"