Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default i need help on a program i am writing

I need to know how I can change the fill color of a range.

Now that is the simple part.

But I need to make a function so that it can be changed by two
different cells.

One cell will change it one color the other cell will change it
another color.

Example: in row three cell a3 has the word "pending"(pending can be in
ne row) in it. Since a3 = pending the color of the row (range from a3
to q3) is yellow (row).
If a3 < "pending" its white (row) also if a3 = e or d color the row
(range from a3 to q3) red (row)
Now if c3 = "yes" then change the row (range from a3 to q3) color to
green if it is no leave row alone.

Also this can happen in ne row so and must be row specific.

i can make it it hapen but not be row specific

i could use ne help please.

thanks

exor
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,344
Default i need help on a program i am writing

Hi,

Your conditions are not exclusive - in other words if A3 < "Pending" color
it white and if A3 = e color it red! If the cell has e in it it is also
<Pending??


--
Thanks,
Shane Devenshire


"exor" wrote:

I need to know how I can change the fill color of a range.

Now that is the simple part.

But I need to make a function so that it can be changed by two
different cells.

One cell will change it one color the other cell will change it
another color.

Example: in row three cell a3 has the word "pending"(pending can be in
ne row) in it. Since a3 = pending the color of the row (range from a3
to q3) is yellow (row).
If a3 < "pending" its white (row) also if a3 = e or d color the row
(range from a3 to q3) red (row)
Now if c3 = "yes" then change the row (range from a3 to q3) color to
green if it is no leave row alone.

Also this can happen in ne row so and must be row specific.

i can make it it hapen but not be row specific

i could use ne help please.

thanks

exor

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,344
Default i need help on a program i am writing

Hi,

Here is some sample code

Sub ColorCells()
Dim cell As Range
For Each cell In Selection
With Range(cell, cell.Offset(0, 13)).Interior
Select Case cell
Case "pending"
.ColorIndex = 6
Case "yes"
.ColorIndex = 2
Case "e"
.ColorIndex = 3
Case Is < "pending"
.ColorIndex = 50
End Select
End With
Next cell
End Sub

In addition to what I stated befo
1. setting a cell to white is different than not filling it with a color
2. this macro will color blank cells because they are < pending
3. as written this code is case insensitive, if this is not what you want
you need to modify the code

To run this macro just select the cells in column A that you want to test
and choose Tools, Macro, Macros, pick the macro and click Run.
--
Thanks,
Shane Devenshire


"exor" wrote:

I need to know how I can change the fill color of a range.

Now that is the simple part.

But I need to make a function so that it can be changed by two
different cells.

One cell will change it one color the other cell will change it
another color.

Example: in row three cell a3 has the word "pending"(pending can be in
ne row) in it. Since a3 = pending the color of the row (range from a3
to q3) is yellow (row).
If a3 < "pending" its white (row) also if a3 = e or d color the row
(range from a3 to q3) red (row)
Now if c3 = "yes" then change the row (range from a3 to q3) color to
green if it is no leave row alone.

Also this can happen in ne row so and must be row specific.

i can make it it hapen but not be row specific

i could use ne help please.

thanks

exor

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default i need help on a program i am writing

On Sep 27, 10:28*pm, ShaneDevenshire
wrote:
Hi,

Here is some sample code

Sub ColorCells()
* * Dim cell As Range
* * For Each cell In Selection
* * * * With Range(cell, cell.Offset(0, 13)).Interior
* * * * * * Select Case cell
* * * * * * * * Case "pending"
* * * * * * * * * * .ColorIndex = 6
* * * * * * * * Case "yes"
* * * * * * * * * * .ColorIndex = 2
* * * * * * * * Case "e"
* * * * * * * * * * .ColorIndex = 3
* * * * * * * * Case Is < "pending"
* * * * * * * * * * .ColorIndex = 50
* * * * * * End Select
* * * * End With
* * Next cell
End Sub

In addition to what I stated befo
1. *setting a cell to white is different than not filling it with a color
2. *this macro will color blank cells because they are < pending
3. *as written this code is case insensitive, if this is not what you want
you need to modify the code

To run this macro just select the cells in column A that you want to test
and choose Tools, Macro, Macros, pick the macro and click Run.
--
Thanks,
Shane Devenshire



"exor" wrote:
I need to know how I can change the fill color of a range.


Now that is the simple part.


But I need to make a function so that it can be changed by two
different cells.


One cell will change it one color the other cell will change it
another color.


Example: in row three cell a3 has the word "pending"(pending can be in
ne row) in it. Since a3 = pending the color of the row (range from a3
to q3) is yellow (row).
If a3 < "pending" its white (row) also if a3 = e or d color the row
(range from a3 to q3) red (row)
Now if c3 = "yes" then change the row (range from a3 to q3) color to
green if it is no leave row alone.


Also this can happen in ne row so and must be row specific.


i can make it it hapen but not be row specific


i could use ne help please.


thanks


exor- Hide quoted text -


- Show quoted text -


thank you shane

it show me alot i can mod this to what i need.

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
Writing a VBA program subvanpatent Excel Programming 11 May 21st 08 02:22 PM
writing a text file in the same folder as my program Takashi Yamauchi Excel Programming 4 January 20th 08 04:59 PM
Writing a program to archive information Admin210 Excel Programming 4 February 23rd 06 12:49 AM
Re writing program - 3/4 rogrammers input on this spreadsheet, ! Felicity Geronimo Excel Programming 1 November 5th 04 01:58 PM
merging excel program with tdc finance program judy Excel Programming 0 November 5th 03 08:01 PM


All times are GMT +1. The time now is 05:11 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"