Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Match Function(Code modification)

Hey guys,

If Application.CountIf(.Range("IV1:IV100"), "Add Stat Name Here") 0 Then
Range("area22").Interior.ColorIndex =
Range("IV1").Interior.ColorIndex
Else
Range("area22").Interior.ColorIndex = 2
End If

Above is a working code that will color a Named Range of cells a specified
color if the value "Productivity" is found in Range ("IV1:IV100"). In this
example the named range is "area22" and the specified color is associated
with the variable "Range("IV1").Interior.ColorIndex". Also in this example
the Value "Productivity is located in cell A4. If the value "Productivity"
is not found in Range ("IV1:IV100"), then Range "area22" will be shaded
color 2.

In the above example, in order for the code to work, you must specify what
value to look for in Range ("IV1:IV100"). Instead, what I would like is for
the code to look in Range ("IV1:IV100") and if it finds the value of cell
A4, then color Range "area22" the variable
"Range("IV1").Interior.ColorIndex". If it does not find the value, then
color Range "area22" color 2.


Thank you


Todd Huttenstine


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default Match Function(Code modification)

Todd, try this

If Application.CountIf(Range("IV1:IV100"), Range("A4")) 0 Then
Range("area22").Interior.ColorIndex = Range("B1").Interior.ColorIndex
Else
Range("area22").Interior.ColorIndex = 2
End If

Cheers
N


"Todd Huttenstine(Remote)" wrote in message
...
Hey guys,

If Application.CountIf(.Range("IV1:IV100"), "Add Stat Name Here") 0 Then
Range("area22").Interior.ColorIndex =
Range("IV1").Interior.ColorIndex
Else
Range("area22").Interior.ColorIndex = 2
End If

Above is a working code that will color a Named Range of cells a specified
color if the value "Productivity" is found in Range ("IV1:IV100"). In

this
example the named range is "area22" and the specified color is associated
with the variable "Range("IV1").Interior.ColorIndex". Also in this

example
the Value "Productivity is located in cell A4. If the value

"Productivity"
is not found in Range ("IV1:IV100"), then Range "area22" will be shaded
color 2.

In the above example, in order for the code to work, you must specify what
value to look for in Range ("IV1:IV100"). Instead, what I would like is

for
the code to look in Range ("IV1:IV100") and if it finds the value of cell
A4, then color Range "area22" the variable
"Range("IV1").Interior.ColorIndex". If it does not find the value, then
color Range "area22" color 2.


Thank you


Todd Huttenstine






----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! 100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default Match Function(Code modification)

correction in line 2 to read "IV1" not "B1"


If Application.CountIf(Range("IV1:IV100"), Range("A4")) 0 Then
Range("area22").Interior.ColorIndex = Range("IV1").Interior.ColorIndex
Else
Range("area22").Interior.ColorIndex = 2
End If


"Nigel" wrote in message
...
Todd, try this

If Application.CountIf(Range("IV1:IV100"), Range("A4")) 0 Then
Range("area22").Interior.ColorIndex =

Range("B1").Interior.ColorIndex
Else
Range("area22").Interior.ColorIndex = 2
End If

Cheers
N


"Todd Huttenstine(Remote)" wrote in message
...
Hey guys,

If Application.CountIf(.Range("IV1:IV100"), "Add Stat Name Here") 0

Then
Range("area22").Interior.ColorIndex =
Range("IV1").Interior.ColorIndex
Else
Range("area22").Interior.ColorIndex = 2
End If

Above is a working code that will color a Named Range of cells a

specified
color if the value "Productivity" is found in Range ("IV1:IV100"). In

this
example the named range is "area22" and the specified color is

associated
with the variable "Range("IV1").Interior.ColorIndex". Also in this

example
the Value "Productivity is located in cell A4. If the value

"Productivity"
is not found in Range ("IV1:IV100"), then Range "area22" will be shaded
color 2.

In the above example, in order for the code to work, you must specify

what
value to look for in Range ("IV1:IV100"). Instead, what I would like is

for
the code to look in Range ("IV1:IV100") and if it finds the value of

cell
A4, then color Range "area22" the variable
"Range("IV1").Interior.ColorIndex". If it does not find the value, then
color Range "area22" color 2.


Thank you


Todd Huttenstine






----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet

News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! 100,000

Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption

=---




----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! 100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Match Function(Code modification)

thanx

it worked.


"Nigel" wrote in message
...
correction in line 2 to read "IV1" not "B1"


If Application.CountIf(Range("IV1:IV100"), Range("A4")) 0 Then
Range("area22").Interior.ColorIndex =

Range("IV1").Interior.ColorIndex
Else
Range("area22").Interior.ColorIndex = 2
End If


"Nigel" wrote in message
...
Todd, try this

If Application.CountIf(Range("IV1:IV100"), Range("A4")) 0 Then
Range("area22").Interior.ColorIndex =

Range("B1").Interior.ColorIndex
Else
Range("area22").Interior.ColorIndex = 2
End If

Cheers
N


"Todd Huttenstine(Remote)" wrote in

message
...
Hey guys,

If Application.CountIf(.Range("IV1:IV100"), "Add Stat Name Here") 0

Then
Range("area22").Interior.ColorIndex =
Range("IV1").Interior.ColorIndex
Else
Range("area22").Interior.ColorIndex = 2
End If

Above is a working code that will color a Named Range of cells a

specified
color if the value "Productivity" is found in Range ("IV1:IV100"). In

this
example the named range is "area22" and the specified color is

associated
with the variable "Range("IV1").Interior.ColorIndex". Also in this

example
the Value "Productivity is located in cell A4. If the value

"Productivity"
is not found in Range ("IV1:IV100"), then Range "area22" will be

shaded
color 2.

In the above example, in order for the code to work, you must specify

what
value to look for in Range ("IV1:IV100"). Instead, what I would like

is
for
the code to look in Range ("IV1:IV100") and if it finds the value of

cell
A4, then color Range "area22" the variable
"Range("IV1").Interior.ColorIndex". If it does not find the value,

then
color Range "area22" color 2.


Thank you


Todd Huttenstine






----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet

News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! 100,000

Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via

Encryption
=---




----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet

News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! 100,000

Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption

=---


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
modification to this code James Excel Discussion (Misc queries) 0 March 23rd 09 09:20 PM
Code modification help AndyMP Excel Worksheet Functions 1 February 8th 09 11:41 PM
line code modification TUNGANA KURMA RAJU Excel Discussion (Misc queries) 3 March 2nd 07 01:12 PM
Sort Code Modification Todd Huttenstine\(Remote\) Excel Programming 1 November 27th 03 08:18 AM
Modification to code Peter Atherton Excel Programming 1 September 23rd 03 07:36 PM


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