Closed Thread
Results 1 to 9 of 9

Check Boxes that highlight entire row

  1. #1
    Registered User
    Join Date
    10-28-2009
    Location
    Sacramento
    MS-Off Ver
    Excel 2007
    Posts
    3

    Check Boxes that highlight entire row

    I've got a friend who runs a DJ show for weddings. He wants me to create an excel sheet with about 8400 song titles, artist, album and track numbers so he can give it out for people to choose the songs they'd like played. He wants them to be able to open the excel sheet on their computer and click the CHECK box to highlight the entire row. I've set up about 20 check boxes (format control) and conditional conditional formatting (=$g2=TRUE()) to highlight the row YELLOW. Obviously 8400 songs going one by one is going to take forever and a day to do. Is there an easier way to do this? I found this event macro online from http://www.mvps.org/dmcritchie/excel/event.htm#case:

    Private Sub Worksheet_Change(ByVal Target As Range)
    'David McRitchie, 2004-09-26, programming, Case -- Entire Row
    ' http://www.mvps.org/dmcritchie/excel/event.htm#case
    If Target.Column <> 6 Then Exit Sub 'Column F is column 6
    If Target.Row = 1 Then Exit Sub
    Application.EnableEvents = False 'should be part of Change macro
    Select Case LCase(Target.Value)
    Case "yes"
    Target.EntireRow.Interior.ColorIndex = 34
    Case "no"
    Target.EntireRow.Interior.ColorIndex = 36
    Case Else
    Target.EntireRow.Interior.ColorIndex = xlColorIndexAutomatic
    End Select
    Application.EnableEvents = True 'should be part of Change macro
    End Sub
    But I'm not too familiar with VBA...

    I appreciate any help anyone is able to provide in making this tedious task go a little faster. I've uploaded what I'm working with as well...

    Nick
    Attached Files Attached Files

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Check Boxes that highlight entire row

    Checkboxes are not a good choice, see this example. Click in Column A to select/se-select
    Attached Files Attached Files
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Expert
    Join Date
    11-27-2007
    Location
    New Jersey, USA
    MS-Off Ver
    2013
    Posts
    1,669

    Re: Check Boxes that highlight entire row

    try this code.
    it will put an X in column A and color next seven cells on the same row.
    modytrane.




    Please Login or Register  to view this content.

  4. #4
    Forum Expert
    Join Date
    11-27-2007
    Location
    New Jersey, USA
    MS-Off Ver
    2013
    Posts
    1,669

    Re: Check Boxes that highlight entire row

    Here's your workbook with the macro installed.
    I had to trim the file to make it smaller.
    You can select and deselect by clicking in the A column.
    modytrane
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    10-28-2009
    Location
    Sacramento
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Check Boxes that highlight entire row

    Thanks for the quick replies! Modytrane. I downloaded what you did (THANKS!) but nothing happens when i click in Column A. I have macros enabled (trusted center) and when clicking the View Macro's nothing comes up. Maybe i did something wrong?

    Thanks again for the help, it'll be a HUGE time saver.

    @RoyUK:
    Checkboxes aren't a good idea? The Windings 2 option for the check box worked when we printed out the list but he wants an interactive excel sheet that customers can click and highlight their selections by clicking in column A. Thanks man!

  6. #6
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Check Boxes that highlight entire row

    When you click the cell in A it triggers conditional formatting in the adjacent cells.

    Click a cell containing the check to clear it.

    That's what you needed

  7. #7
    Registered User
    Join Date
    10-28-2009
    Location
    Sacramento
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Check Boxes that highlight entire row

    Perfect thanks! That's awesome saved me ton's of time! Is there anyway to make the highlight color yellow instead of blue? I was looking at the code and didn't see a place that mentioned any colors.

    Thanks again

  8. #8
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Check Boxes that highlight entire row

    If you are refeerring to my suggestion, then the lines are coloured with Conditional Formatting. Just change the Format in the Conditional Format

  9. #9
    Forum Expert
    Join Date
    11-27-2007
    Location
    New Jersey, USA
    MS-Off Ver
    2013
    Posts
    1,669

    Re: Check Boxes that highlight entire row

    Number 34 [highlighted in RED] below needs to be changed to the color of your choice.
    Use the attached file to select the number for the color.
    modytrane.



    Please Login or Register  to view this content.
    Attached Files Attached Files

Closed 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