+ Reply to Thread
Results 1 to 2 of 2

Changing font colors in rows of match data

  1. #1
    Registered User
    Join Date
    10-09-2012
    Location
    Lihue, HI
    MS-Off Ver
    Excel 2010
    Posts
    3

    Changing font colors in rows of match data

    Aloha,

    I have an Excel file with two sheets of hotel guest reservations. The greater purpose of this Excel file is help me quickly identify reservations that may have more than one room (such as a family traveling together with the same last name but different first name). One sheet has a master guest list of arrivals over the next 30 days and the other sheet has a list of guests that I had previously identified with multiple rooms.

    I am having a problem with one small step in the overall program. I am attempting to program the macro to change the font color to red for reservations on the master Guest List that I have previously identified as part of a multiple room reservation.

    The two sheets are named "Guest List" and "Already Identified".

    I have two variables - AIResNum ("Already Identified Reservation Number") and GLResNum ("Guest List Reservation Number) which are the resevation numbers I am compareing between both sheets. I also have two "line feed" variables "GLRow" and "AIRow".

    I basically programmed the macro to loop through and compare if AIResNum and GLResNum are equal and if they are it is supposed to change the font color for the entire row of the matching reservation as appears on the "Guest List" sheet the color red but the macro crashes Excel every time when it finds a match.

    I am new at this so I cam imagine there may be a more elegent way to program this loop however, it seems to work all the same except when I set the color for the row to red. I have highlighted the line that seems to crash the macro in red below. I have tried putting in script that deletes such matches and that works effectively, but I really don't want to delete the data -- I just want to change the text color to red. Here is the script:

    Please Login or Register  to view this content.
    Mahalo for your help,

    Andrew
    Last edited by Cutter; 10-17-2012 at 08:28 PM. Reason: Added code tags

  2. #2
    Forum Expert Tsjallie's Avatar
    Join Date
    09-15-2012
    Location
    NL
    MS-Off Ver
    2010, 2013, 2016
    Posts
    2,077

    Re: Changing font colors in rows of match data

    Hi Andrew,
    I think the syntax of the if-then-else statement is incorrect.
    Now all the code between THEN and ELSE is evaluated as an expression, so nothing happens.
    You need to replace "And" with ":" if you want both instructions executed.
    Please Login or Register  to view this content.
    Cheers!
    Tsjallie




    --------
    If your problem is solved, pls mark the thread SOLVED (see Thread Tools in the menu above). Thank you!

    If you think design is an expensive waste of time, try doing without ...

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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