View Single Post
  #13   Report Post  
Posted to microsoft.public.excel.programming
Auric__ Auric__ is offline
external usenet poster
 
Posts: 538
Default Formula to macro...anyone??

On Wed, 03 Dec 2003 18:35:35 -0800, adidas VBA wrote:

I still cant figure out what the problem is after you sent me the code.
I entered =nocoffeebreak4u(ROW()) in cell M2 on the spreadsheet, and no
matter what I do with the values, I cant get any other result other than
0.


Where did you paste the code? A module?

If cells in column G are less than or equal to 20030905, and cells in
column H are greater than or equal to 20030905, then the value should be
1.


Are the dates entered as plain text, or as dates? Meaning, if you select
the cell and look at the formula, does it say "20030905" or does it say
"9/5/2003"? My code is actually set to deal with the value as a number,
which (upon reviewing) *could* be incorrect, but for any correction I
need to know how the data is handled.

Once this condition is satisfied, then if the fifth element of the
data array in Column I should be "Y", for the value to be = 1, and once
this is met we implement the previous 5 conditions. I think that the
macro you have says "or" for the condition between column G and H,
should be "and".


Look again - I reversed the comparison. Your formula said "if G2 is at
least 20030905, and H2 is no more than 20030905, and the fifth character
of I2 is "Y", then 1, else 0". I reversed that - "if G2 is less than
20030905, or H2 is more than 20030905, or the fifth character of I2 is
not "Y", then 0 (false), else 1 (true)". It is the exact same thing -
"(G2 = 20030905) = true" is logically equivalent to "(G2 < 20030905) =
false". The OR is there because, while your code is making sure that
everything is *right*, mine makes sure that nothing is *wrong* - catch
the difference?

The previous 5 conditions have been covered correctly
from what I can tell. Could you please assist, and yes many cheers to
you. Email beers to follow. Thanks.


You're welcome. Before posting again, try playing around with the code
yourself. (I'm serious - I've taken on another job for the holidays and
my free time is currently worth its weight in gold.) The code is
actually pretty close to the original formula you posted.
--
auric "underscore" "underscore" "at" hotmail "dot" com
*****
There is no such thing as bravery; only degrees of fear.