Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default Macro to set cell interior color?

I'd like to create a macro that will fill the current cell (or cells) with
whatever the current fill color is.

I tried to record a macro to do this, but it always fills the cell with the
color that was current when the macro was recorded.

Perhaps I could modify that macro in the VBA editor ... but I don't know
what value to use for the color index.

Any help is greatly appreciated.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,942
Default Macro to set cell interior color?

hi
if you recorded a macro then you know the code syntax. all you need is the
color index numbers.
http://www.mvps.org/dmcritchie/excel/colors.htm

regards
FSt1

"imoose" wrote:

I'd like to create a macro that will fill the current cell (or cells) with
whatever the current fill color is.

I tried to record a macro to do this, but it always fills the cell with the
color that was current when the macro was recorded.

Perhaps I could modify that macro in the VBA editor ... but I don't know
what value to use for the color index.

Any help is greatly appreciated.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default Macro to set cell interior color?

Actually, the behavior I was hoping to create was for me to be able to set
the color in the Fill Color picker, and then, as I'm entering data in cells,
to be able to keep my hands on the keyboard and use the macro key-combo to
color the cells as I go.

BUT ALSO that, if I change the Fill Color in the picker, the macro will then
use the new ("current") color.

So, I guess I want to know how to make a macro that will fill the cell with
whatever is the "current" color in the Fill Color picker.

Is that even possible?
imoose

"Don Guillett" wrote:

Search for a color index table or record a macro with the color you want to
see.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"imoose" wrote in message
...
I'd like to create a macro that will fill the current cell (or cells) with
whatever the current fill color is.

I tried to record a macro to do this, but it always fills the cell with
the
color that was current when the macro was recorded.

Perhaps I could modify that macro in the VBA editor ... but I don't know
what value to use for the color index.

Any help is greatly appreciated.



  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,124
Default Macro to set cell interior color?

How about a vlookup table with
yellow 6
blue 5
etc
cell d2 datavalidationlistselect e3:e and your end of list
in cell e2 =vlookup(d2,e3:e23,2,0)
OR JUST PUT A COLOR IN CELL E2 FROM THE PICKER.
then right click sheet tabview codeinsert the code below
Now when you change a cell in f2:f5 the color in e2 will be used.

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("f2:f5")) Is Nothing Then Exit Sub
Target.Interior.ColorIndex = Range("e2")

End Sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"imoose" wrote in message
...
Actually, the behavior I was hoping to create was for me to be able to set
the color in the Fill Color picker, and then, as I'm entering data in
cells,
to be able to keep my hands on the keyboard and use the macro key-combo to
color the cells as I go.

BUT ALSO that, if I change the Fill Color in the picker, the macro will
then
use the new ("current") color.

So, I guess I want to know how to make a macro that will fill the cell
with
whatever is the "current" color in the Fill Color picker.

Is that even possible?
imoose

"Don Guillett" wrote:

Search for a color index table or record a macro with the color you want
to
see.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"imoose" wrote in message
...
I'd like to create a macro that will fill the current cell (or cells)
with
whatever the current fill color is.

I tried to record a macro to do this, but it always fills the cell with
the
color that was current when the macro was recorded.

Perhaps I could modify that macro in the VBA editor ... but I don't
know
what value to use for the color index.

Any help is greatly appreciated.






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
No Interior Color Macro simplymidori[_2_] Excel Discussion (Misc queries) 1 April 11th 08 05:01 AM
Test cell interior color by worksheet function? Skimmer Excel Worksheet Functions 7 September 4th 07 09:40 PM
Cell interior color JohnB Excel Discussion (Misc queries) 4 October 12th 06 06:07 PM
Need Excel Formula/Function to color cell interior akaster Excel Worksheet Functions 2 April 19th 06 06:30 PM


All times are GMT +1. The time now is 05:16 PM.

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

About Us

"It's about Microsoft Excel"