Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Change Cell-Background color into Text


Hello,

I have a big table which maps our members' presence to dates by using
special cell background color. So for example one color means "is ill
and another means "is present" and so on...
Unfortunately I have to transfer this table to a sql database and
could not find a way to export cell-background colors to a .csv file.

So my question is:

Is there a simple way to change the celltext according to the cell'
background-color in the whole worksheet ?

For example:
cell-background = "none user set color" - cell-text = ""
cell-background = "green" - cell-text = "green"
cell-background = "red" - cell-text = "red"

and so on ...


Thank you for your answers

K. Tückin

--
Kai Tückin
-----------------------------------------------------------------------
Kai Tücking's Profile: http://www.excelforum.com/member.php...fo&userid=1525
View this thread: http://www.excelforum.com/showthread.php?threadid=26882

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Change Cell-Background color into Text


Here is some code that could be made into what you need - the first is
macro to find the number associated with the colors you use and th
second inserts the color name (one cell over) of the background color

Option Explicit

Sub FindColor()
Range("A1").Select
Do
MsgBox "Cell color is " & Selection.Interior.ColorIndex
ActiveCell.Offset(1, 0).Select
Loop Until Selection.Interior.ColorIndex = -4142 'No Fill Color
End Sub

Sub Color2Text()
Range("A1").Select
Do
Select Case Selection.Interior.ColorIndex
Case Is = 1
ActiveCell.Offset(0, 1).Value = "Black"
Case Is = 9
ActiveCell.Offset(0, 1).Value = "Dark Red"
Case Is = 3
ActiveCell.Offset(0, 1).Value = "Red"
Case Is = 7
ActiveCell.Offset(0, 1).Value = "Pink"
Case Is = 38
ActiveCell.Offset(0, 1).Value = "Rose"
' etc, etc...
End Select
ActiveCell.Offset(1, 0).Select
Loop Until Selection.Interior.ColorIndex = -4142
End Sub


Jorda

--
jordanct
-----------------------------------------------------------------------
jordanctc's Profile: http://www.excelforum.com/member.php...nfo&userid=676
View this thread: http://www.excelforum.com/showthread.php?threadid=26882

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
change background row color with change of date in a cell Urszula Excel Discussion (Misc queries) 5 May 17th 06 07:56 AM
change cell background color when another cell's value = 40 da haole boy Excel Discussion (Misc queries) 2 February 19th 06 01:42 AM
how do I change cell background color only when cursor is over it Victor Cassano Excel Discussion (Misc queries) 1 August 10th 05 09:42 PM
Change of text or background color doesn't change on the screen. Susan Excel Discussion (Misc queries) 5 July 29th 05 07:18 PM
background color of my cell does not change Colorblinded Excel Discussion (Misc queries) 2 March 27th 05 04:55 PM


All times are GMT +1. The time now is 04:34 PM.

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"