+ Reply to Thread
Results 1 to 13 of 13

Conditional formatting from separate pages

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    01-12-2004
    Location
    Nebraska, USA
    MS-Off Ver
    Office 365
    Posts
    167

    Talking

    Hello Charles....

    Sorry it took me so long to get back to you.
    I attached your latest code to the end of my SORT macro...and it worked exactly as planned.

    In your last reply, you stated:

    If neither is found the sheet1 name will remain without color.(unless you added a name on sheet1 that had the cell fromatted for either cat. and that name was not in sheet2 the color will remain)
    This was exactly the case...and something that had to be corrected, since the names in the cells on Sheet 1 were constantly being changed each time the SORT macro was run.

    My simple solution was to add the following code AHEAD of your code...to clear the formatting prior to your code's execution.

      Range("A1:AA200").Select
        With Selection.Font
            .FontStyle = "Regular"
          Selection.Interior.ColorIndex = xlNone
        End With
    The unfortunate side effect of all of this...??? ...My SORT macro now takes longer to run...(about 10-12 seconds).
    Since I have ScreenUpdating set to FALSE on the macro...I now need to figure out how to attach a STATUS BAR to the macro so that the user doesn't feel like nothing is happening, or that the program has hung.

    Going to get to work on that, right now.

    Thanks a bunch for your help with this.
    I've learned a great deal more about VBA from this exercise.

  2. #2
    Valued Forum Contributor Charles's Avatar
    Join Date
    02-10-2004
    Location
    Biloxi
    MS-Off Ver
    Windows 7, Excel 2003,2007 & Mac2011
    Posts
    845
    Hi,


    I don't think it's necessary for the code to set Font style to Regular.
    The below code may be a little faster.

    
    Range("A1:AA200").Interior.ColorIndex = xlNone
    Charles

    There are other ways to do this, this is but 1 !
    Be Sure you thank those who helped.
    IF YOU'RE SATISFIED BY ANY MEMBERS RESPONSE TO YOUR ISSUE PLEASE USE THE STAR ICON AT THE BOTTOM LEFT OF THE POST UNDER THEIR NAME.

  3. #3
    Forum Contributor
    Join Date
    01-12-2004
    Location
    Nebraska, USA
    MS-Off Ver
    Office 365
    Posts
    167

    Arrow

    Hello, again, Charles....

    In your last reply, you stated the following:

    I don't think it's necessary for the code to set Font style to Regular.
    I failed to mention that my SORT macro sets Sheet1 matches to bold.
    (Actually, I modified YOUR code to do so...before I added it to my SORT macro).
    Therefore, I needed to reset the font prior to running your new code.

    I considered leaving the font 'Regular' throughout the sort process...to speed up the macro.
    After removing that code...and removing code to reset the font to 'Regular'...
    the macro execution time wasn't noticeably diminished.

    Perhaps I could reply with the exact code I am using in my workbook...and you might see other ways that I might speed up this macro. I am sure, due to my inexperience with VBA, that some of my code is redundant...or even completely unnecessary.

    Would you be interested in glancing at this code, and offering your advice??

    I thank you for the help that you have given me, so far. The educational value of this forum is "off the charts". I have yet to post a question that couldn't be answered to my satisfaction. I can't thank you enough for the time and thoughtfulness that you put into this forum.

    My thanks go out to the following moderators and registered users, as well:

    VBA Noob - kraljb - duane - Bryan Hessey - Special-K - JR@SGC - tony h - jtp - davesexcel - Carim - MSP77079 - vane0326 - Dav - Clayton Lock - rylo - dominicb - Norie - downforce - Leith Ross - Mikerickson - ChemistB - Aladin Akyurak - and last but not least...daddylonglegs.

+ 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