+ Reply to Thread
Results 1 to 1 of 1

Changing Background Colors and font colors in excel 2016 vba - need help with macro

  1. #1
    Forum Contributor
    Join Date
    07-20-2015
    Location
    Jacksonville, Florida
    MS-Off Ver
    Excel 2016
    Posts
    313

    Changing Background Colors and font colors in excel 2016 vba - need help with macro

    I am trying to change background colors and some font colors in a macro. This is needed for a 32 team double elimination tournament I'm developing. The following code works in a macro I have named: TEMP

    Please Login or Register  to view this content.
    The workbook is named DoubleElimDrawSheet.xlsm and the macro is named TEMP

    What I want tho is to change certain cells background and font colors when a change occurs. I've set up code in workbook: DoubleElimResults.xlsm I'm not sure what the vba code is referred to if you right click the worksheet tab named "Results".

    Basically that code in the view code window is identical to the two lines of code above and in the TEMP macro.

    I've set it up in the DoubleElimResults.xlsm worksheet: Results so when a change occurs in array $B$2:$B$35 then the macro gets some info relating to the match changes and goes to the DoubleElimDrawSheet.xlsm to color the appropriate cells.

    I've single stepped thru the view code macro and it executes the same code above in the process but it does not take effect and the cell background color remains unchanged. In order to invoke the code in the Results worksheet you just go to cell "B18" and change the value from "Upper" to "Lower" or from "Lower" to "Upper"

    I put a pause in the view code macro to enable single stepping thru the code.

    There is a 3rd workbook that is used in the process but isn't part of the issue but I'm attaching it as well. It is named DoubleElimEntries.xlsm

    I realize I can do what I need to do using Conditional Formatting however the further out in the brackets there is a larger multiple of players who could have won/lost and at the very final bracket there will be 32 possible teams and therefore I'd need to set up 32 more conditions for both the final team in the loser bracket and 32 in the winner bracket - in the round prior it would be 16 in each side of the worksheet.

    OOOPS - I just discovered the code is not shifting from the Results book to the DrawSheet book and the coloring of the cell is occurring in the Results sheet (which is NOT what I need). So the real question is can I shift to the DrawSheet book from the view code macro in the Results book. Here's the line of code in the view code macro in the Results book that I thought would shift me to the DrawSheet book:


    [code] Windows("DoubleElimDrawSheet.xlsm").Activate [code/]

    Thanks for any assistance..
    Attached Files Attached Files
    Last edited by pongmeister; 02-27-2018 at 01:02 AM.

+ 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. Replies: 0
    Last Post: 09-27-2017, 02:34 PM
  2. VBA code for changing font colors
    By Immortal2014 in forum Excel General
    Replies: 45
    Last Post: 12-06-2016, 06:22 AM
  3. Excel 2010 font and background colors
    By Wyldemaverick in forum Excel General
    Replies: 1
    Last Post: 07-25-2012, 04:05 PM
  4. Background and Font Colors Printing Differently
    By gshulman in forum Excel General
    Replies: 0
    Last Post: 02-09-2012, 03:21 PM
  5. [SOLVED] changing colors of font in functions
    By andreee in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-02-2006, 08:15 AM
  6. Replies: 1
    Last Post: 10-14-2005, 11:05 AM
  7. Can't format font colors or cell fill-in colors
    By canoeron in forum Excel General
    Replies: 3
    Last Post: 08-22-2005, 07:05 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