+ Reply to Thread
Results 1 to 3 of 3

Trying to duplicate conditional formatting used in report n access to excel sheet

  1. #1
    Registered User
    Join Date
    11-28-2012
    Location
    Houston
    MS-Off Ver
    Excel 2010
    Posts
    2

    Trying to duplicate conditional formatting used in report n access to excel sheet

    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
    Attached Files Attached Files

  2. #2
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885

    Re: Trying to duplicate conditional formatting used in report n access to excel sheet

    Hi Axsprog,

    See the attached Excel file using Conditional Formatting in cells C2:Q4.

    I selected that range, then using Conditional Formatting created two new rules using formulas:

    Formula 1 (Red): =AND(SUM($C2:C2)>$B2,C2<>"")

    Formula 2 (Green): =AND(SUM($C2:C2)<=$B2,C2<>"")

    Set the formats to the color, bold font and outline border. Hope that helps!
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    11-28-2012
    Location
    Houston
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Trying to duplicate conditional formatting used in report n access to excel sheet

    The example provided is perfect other than every time I try to expand it to the number of columns I need (through AB) it either fails on B2 or continues out past AB which I do not want. I am uploading the template I need to use and the working model submitted to me , if anyone can help I would greatly appreciate it
    You would think functions and functionality in an office suite product would cross over to other office suite products arrrggghhh
    rptexecution is the concept of what I need and the axsprog which was provided to me is exactly what I need it to do. the sheet goes out to from the evaluated column of B to the range of columns from C to AB and
    the maximum number of rows would never be more than 100

    Thank you
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] EXCEL conditional formatting on Microsoft access database not working
    By cascencio83 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 03-03-2015, 11:19 PM
  2. Replies: 5
    Last Post: 05-18-2013, 08:32 PM
  3. Count the number of duplicates in a sheet, report the duplicate cells to a new sheet.
    By SamPetroda in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-25-2012, 09:48 AM
  4. [SOLVED] Conditional formatting of duplicate rows (not duplicate cells)
    By ExcelStefan in forum Excel General
    Replies: 2
    Last Post: 06-19-2012, 06:09 AM
  5. Displaying an image conditional on an Access Report
    By ctsmith84 in forum Access Programming / VBA / Macros
    Replies: 1
    Last Post: 12-09-2011, 01:55 PM
  6. Run Access report from Excel ?
    By rwilsonie in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-13-2011, 02:57 PM
  7. Range conditional formatting in Excel from Access VBA
    By Michel S. in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-14-2006, 10:25 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1