+ Reply to Thread
Results 1 to 10 of 10

Need help on a macro instead of conditional formatting.

Hybrid View

Roco Need help on a macro instead... 09-19-2017, 03:45 PM
xladept Re: Need help on a macro... 09-19-2017, 04:01 PM
Roco Re: Need help on a macro... 09-19-2017, 04:12 PM
xladept Re: Need help on a macro... 09-19-2017, 04:33 PM
Roco Re: Need help on a macro... 09-19-2017, 06:18 PM
xladept Re: Need help on a macro... 09-19-2017, 06:29 PM
Roco Re: Need help on a macro... 09-19-2017, 09:39 PM
xladept Re: Need help on a macro... 09-19-2017, 10:04 PM
Roco Re: Need help on a macro... 09-21-2017, 05:38 AM
xladept Re: Need help on a macro... 09-21-2017, 11:18 AM
  1. #1
    Forum Contributor
    Join Date
    02-02-2013
    Location
    Jacksonville, Florida
    MS-Off Ver
    Excel 2010
    Posts
    169

    Need help on a macro instead of conditional formatting.

    I tried to use this formula [=IF($E$11:$E$207,IsBold)] to highlight the bold numbers, but I am getting nothing. Any help on this would be greatly appreciated.

    popipipo tried helping me out with [=ISNUMBER(FIND("Total",A1,1))], which worked in conditional formatting until I would hit the "Refresh" button and then it would disappear out of conditional formatting.

    Looks like I would need to have some help getting this done with using a macro. Any help on this would be greatly appreciated. Please see attached file.

    Roco
    Attached Files Attached Files

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Need help on a macro instead of conditional formatting.

    This works when there are bold numbers in E (the sample had none):

    Sub RocoH(): Dim R As Range
    For Each R In Range("E11:E" & Range("E" & Rows.count).End(xlUp).Row)
    If R.Font.Bold = True Then R.Interior.ColorIndex = 6
    Next: End Sub
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Forum Contributor
    Join Date
    02-02-2013
    Location
    Jacksonville, Florida
    MS-Off Ver
    Excel 2010
    Posts
    169

    Re: Need help on a macro instead of conditional formatting.

    Is it possible for it to look for the text "Total" and high the whole row instead?

    Roco

  4. #4
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Need help on a macro instead of conditional formatting.

    You can look for just about anything - at a quick glance I saw no "Total" by itself?

  5. #5
    Forum Contributor
    Join Date
    02-02-2013
    Location
    Jacksonville, Florida
    MS-Off Ver
    Excel 2010
    Posts
    169

    Re: Need help on a macro instead of conditional formatting.

    Total is not by itself....but if you look close enough you will see it just to the left of where the column E is being total for each item.

  6. #6
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Need help on a macro instead of conditional formatting.

    Then this:

    Sub RocoHT(): Dim r As Range
    For Each r In Range("A11:A" & Range("A" & Rows.count).End(xlUp).Row)
    If InStr(1, r.Value, "Total") Then r.Interior.ColorIndex = 6
    Next: End Sub

  7. #7
    Forum Contributor
    Join Date
    02-02-2013
    Location
    Jacksonville, Florida
    MS-Off Ver
    Excel 2010
    Posts
    169

    Re: Need help on a macro instead of conditional formatting.

    That works great...can you make it so that it includes one more cell in each row that has "Total" so that it includes the cell in column "E".

  8. #8
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Need help on a macro instead of conditional formatting.

    There is no such cell in E but:

    Sub RocoHT(): Dim r As Range
    For Each r In Range("A11:A" & Range("A" & Rows.count).End(xlUp).Row)
    If InStr(1, r.Value, "Total") Then r.Interior.ColorIndex = 6
    If InStr(1, r.Offset(0, 4).Value, "Total") Then r.Interior.ColorIndex = 6
    Next: End Sub
    Ought to do it

  9. #9
    Forum Contributor
    Join Date
    02-02-2013
    Location
    Jacksonville, Florida
    MS-Off Ver
    Excel 2010
    Posts
    169

    Re: Need help on a macro instead of conditional formatting.

    Thanks for taking a look and helping me out on this...I appreciate your time.

    Roco

  10. #10
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Need help on a macro instead of conditional formatting.

    You're welcome and thanks for the rep!

+ 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. Macro to set up conditional message based on results of conditional formatting
    By paysola in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-04-2016, 12:38 AM
  2. Conditional Formatting Using Macro
    By scambug in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-06-2012, 07:54 AM
  3. Macro for formatting fonts and cell colours - not Conditional Formatting
    By Kayaness in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-07-2011, 03:46 AM
  4. Macro for Conditional Formatting
    By Humanist in forum Excel - New Users/Basics
    Replies: 7
    Last Post: 10-27-2010, 09:13 AM
  5. Conditional Formatting Macro
    By Colleenn in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-12-2009, 08:01 PM
  6. Macro - Conditional Formatting
    By soniarun in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-18-2008, 12:28 PM
  7. [SOLVED] Do I have to use Conditional Formatting or a Macro?
    By tanilov@yahoo.it in forum Excel General
    Replies: 2
    Last Post: 03-08-2006, 05:10 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