close

Can I run a macro from a cell function in Excel 2003 with the idea of
comparing 1 value against another and if its true, it gets highlighted yellow?

Thanks

Hi Redragon,

This sounds like a case for conditional formatting (i.e.
Format|Cells|Conditional Formatting), which allows you to specify up to
three formats in addition to the cell's underlying format, depending on
whether the conditions you specify are met. No vba required.

Cheersquot;Redragonquot; gt; wrote in message
...
gt; Can I run a macro from a cell function in Excel 2003 with the idea of
gt; comparing 1 value against another and if its true, it gets highlighted
yellow?
gt;
gt; Thanks
Thanks for replying, but I've already tried the condition al formatting and
for my project 3 conditions is not enough, any ideas?

Thanks

quot;macropodquot; wrote:

gt; Hi Redragon,
gt;
gt; This sounds like a case for conditional formatting (i.e.
gt; Format|Cells|Conditional Formatting), which allows you to specify up to
gt; three formats in addition to the cell's underlying format, depending on
gt; whether the conditions you specify are met. No vba required.
gt;
gt; Cheers
gt;
gt;
gt; quot;Redragonquot; gt; wrote in message
gt; ...
gt; gt; Can I run a macro from a cell function in Excel 2003 with the idea of
gt; gt; comparing 1 value against another and if its true, it gets highlighted
gt; yellow?
gt; gt;
gt; gt; Thanks
gt;
gt;
gt;

If you can't use Conditional Format for your problem, then you will have to
use VBA. But you cannot get a cell function/formula to run a macro. There
are a number of ways to run a macro, even automatically, but you don't
provide enough information. Post back and tell us what you are trying to do
with more detail this time. HTH Otto
quot;Redragonquot; gt; wrote in message
...
gt; Thanks for replying, but I've already tried the condition al formatting
gt; and
gt; for my project 3 conditions is not enough, any ideas?
gt;
gt; Thanks
gt;
gt; quot;macropodquot; wrote:
gt;
gt;gt; Hi Redragon,
gt;gt;
gt;gt; This sounds like a case for conditional formatting (i.e.
gt;gt; Format|Cells|Conditional Formatting), which allows you to specify up to
gt;gt; three formats in addition to the cell's underlying format, depending on
gt;gt; whether the conditions you specify are met. No vba required.
gt;gt;
gt;gt; Cheers
gt;gt;
gt;gt;
gt;gt; quot;Redragonquot; gt; wrote in message
gt;gt; ...
gt;gt; gt; Can I run a macro from a cell function in Excel 2003 with the idea of
gt;gt; gt; comparing 1 value against another and if its true, it gets highlighted
gt;gt; yellow?
gt;gt; gt;
gt;gt; gt; Thanks
gt;gt;
gt;gt;
gt;gt;
Well, I want to compare 6 numbers against another 6 numbers which are set. So
I want the first number to check against all 6 of the set numbers and then
the second number to check all the set numbers and so on, and if they match I
want the number to highlight in yellow. So if we say: -

Set Chosen
3 6 This 6 is in the 'Set' Number list
6 10
12 14
13 17 This 17 is in the 'Set' number list
17 20
21 27

So basically I want the 6 and 17 in the 'Chosen' list to be highlighted in
yellow.
Are you with me? And any ideas if so?

Thanks


Hi,
You've tried conditional formatting amp; say that 3 conditions is not
enough, but if you have used all 3 conditions to solve this request -
then there will be enough as this can be done with a single condition
in conditional formatting, ie:
=ISNUMBER(MATCH(B2,$A$2:$A$7,0))

However, if you are already using the 3 conditions for other
formatting, have a look at (amp; the linked pages):
www.contextures.com/xladvfilter01.html

hth
Rob Brockett
NZ
Always learning amp; the best way to learn is to experience...--
broro183
------------------------------------------------------------------------
broro183's Profile: www.excelforum.com/member.php...oamp;userid=30068
View this thread: www.excelforum.com/showthread...hreadid=537442Hi again, sorry to be a pain, but could you explain to me how that function
and each part of it works: -

=ISNUMBER(MATCH(B2,$A$2:$A$7,0))

Thanks ever so much!

quot;broro183quot; wrote:

gt;
gt; Hi,
gt; You've tried conditional formatting amp; say that 3 conditions is not
gt; enough, but if you have used all 3 conditions to solve this request -
gt; then there will be enough as this can be done with a single condition
gt; in conditional formatting, ie:
gt; =ISNUMBER(MATCH(B2,$A$2:$A$7,0))
gt;
gt; However, if you are already using the 3 conditions for other
gt; formatting, have a look at (amp; the linked pages):
gt; www.contextures.com/xladvfilter01.html
gt;
gt; hth
gt; Rob Brockett
gt; NZ
gt; Always learning amp; the best way to learn is to experience...
gt;
gt;
gt; --
gt; broro183
gt; ------------------------------------------------------------------------
gt; broro183's Profile: www.excelforum.com/member.php...oamp;userid=30068
gt; View this thread: www.excelforum.com/showthread...hreadid=537442
gt;
gt;

Hi RedDragon,

The problem you've described accounts for only one condition, so Conditional
Formatting is a candidate.

Rob's formula (for cell B2) uses the MATCH function to test whether the
value in the cell being tested is found in the test range (A2:A7), whilst
the 0 in the function specifies that an exact match is required. When the
MATCH function gets a 'hit' it returns the offset to the first match and,
the 0 causes it to return 'N/A' if there is no match. The ISNUMBER function
then tests the MATCH function's results for the presence of any number, and
returns 'TRUE' if MATCH has returned a number. Inserted into a Conditional
Formatting formula dialogue box, the 'TRUE' result then drives the
formatting.

If you place Rob's formula in cell C2, instead of using it as a conditional
formatting formula, and copy it down, you'll get an idea of what it's doing.

Cheers

quot;Redragonquot; gt; wrote in message
...
gt; Well, I want to compare 6 numbers against another 6 numbers which are set.
So
gt; I want the first number to check against all 6 of the set numbers and then
gt; the second number to check all the set numbers and so on, and if they
match I
gt; want the number to highlight in yellow. So if we say: -
gt;
gt; Set Chosen
gt; 3 6 This 6 is in the 'Set' Number
list
gt; 6 10
gt; 12 14
gt; 13 17 This 17 is in the 'Set' number
list
gt; 17 20
gt; 21 27
gt;
gt; So basically I want the 6 and 17 in the 'Chosen' list to be highlighted in
gt; yellow.
gt; Are you with me? And any ideas if so?
gt;
gt; Thanks

hi all,

RedDragon, does that clarify the function for you?

Macropod, Thanks for the concise explanation. Just out of curiosity,
would you have used Match, or another function (eg vlookup, countif
etc)?

Rob Brockett
NZ
Always learning amp; the best way to learn is to experience...--
broro183
------------------------------------------------------------------------
broro183's Profile: www.excelforum.com/member.php...oamp;userid=30068
View this thread: www.excelforum.com/showthread...hreadid=537442Hi Rob,

A COUNTIF function would probably have been the simplest to implement. For
example:
=COUNTIF($A$2:$A$7,B2)gt;0

Cheersquot;broro183quot; gt; wrote in
message ...
gt;
gt; hi all,
gt;
gt; RedDragon, does that clarify the function for you?
gt;
gt; Macropod, Thanks for the concise explanation. Just out of curiosity,
gt; would you have used Match, or another function (eg vlookup, countif
gt; etc)?
gt;
gt; Rob Brockett
gt; NZ
gt; Always learning amp; the best way to learn is to experience...
gt;
gt;
gt; --
gt; broro183
gt; ------------------------------------------------------------------------
gt; broro183's Profile:
www.excelforum.com/member.php...oamp;userid=30068
gt; View this thread: www.excelforum.com/showthread...hreadid=537442
gt;

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()