Here is the scenario: I have a table in Access(greatest software program ever lol) that is laid out like a grid for week of data looks like the following in datasheet mode The data is compiled from data in Pervasive SQL Application called Global Shop Under each "dated column is the number of parts needed by contract during that week.
PartNo OnHandAmt Wk1 Wk2 Wk3 Wk4 Wk5 and so on through wk26
The report generated takes the beginning of the wk of whatever day the report is run and on the print preview formats the Filed names as follows with data and in the data
PartNo OnhandAmt 04/19 04/26 05/03 05/10 05/17 and so on until 10/11
ABC123 400 30 85 33 300 200
XYZ456 30 5 28 20 15 0
The report is designed to show with Green background fields (Excel calls them cells) when ever the amount is less than the onhandamt and red when that onhandamt threashold will be exceeded
for example
abc123 onhND IS 400 SO 04/19 Will be shaded in green
then a for wk2 (04/26) you subtract wk1 + wk2 from onhandamt tosee if the value of WK2 is less (and it is ) so that too gets shaded in green
Anothe words 30 <= 400 - (30 + 85)
Then evaluate wk3 (05/03)
is 33 <= 400 - (Wk1 + wk2 + wk3) yes because 33 is less than or equal to 400 - 148 or 252
However when I evaluate wk4 (05/03) That number is greater than
400 - (30 + 85 + 33 + 300) = negative 48
so it gets a red background and the remainder of the fields in that row for any value greater than 0 will be red
in conditional formatting for Access it looks like this for wk1
Field Value Is LessThan or Equal to Nz([qty],0)
for wk2 it is
Field Value Is Less Than or Equal TO Nz([qty],0)-([wk1]+[wk2])
wk3
Field Value Is Less Than or Equal TO Nz([qty],0)-([wk1]+[wk2] + [wk3])
etc
it works beautifully .....In Access
Now my boss wants to export it to excel and see the same thing aaaarrrrrgggghhhh?
Access allows you to name all the values in a column by the field name - ie WK1 ,Wk2 and I tried to use Named Ranges to do the same but it does not seem grasp the math involved in the evaluation I am beginning to think that I will have to create the excel object in vba from access - do the evaluation of the cell and then define the colors of the cell and save the object - which I do not need help doing that but it sure would help and save time if I could define the conditional formatting of the excel columns like I did in Access
I have tried to attach an example and I was able to upload but I do not know where it is lol
Bookmarks