+ Reply to Thread
Results 1 to 8 of 8

Changes entire row to a certain color

  1. #1
    Registered User
    Join Date
    12-12-2009
    Location
    Dallas, TX
    MS-Off Ver
    Excel 2003
    Posts
    5

    Smile Changes entire row to a certain color

    Ok,

    So im very new to the Excel thing and even newer to VBA. In fact this is the first day I even knew what VBA is! So please forgive me and a very spelled out answer would be much appreciated.

    Today I have figured out how to create the button, assign the macro to it, but have no clue the correct code.

    For example, I found this code on MS website that I programed to my button but even when selecting the entire line it only changes the color of that specific cell.

    Please Login or Register  to view this content.
    However, I need to be able to click on the row then click the button and the entire row change that color.
    Last edited by dominicb; 12-12-2009 at 06:57 PM.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: How do I program a button that changes entire row to a certain color?

    Welcome to the forum.

    Why not just select the row and press the Fill Color button?
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Smile Re: How do I program a button that changes entire row to a certain color?

    Good evening Darrell456

    ...and welcome to the forum!!
    Quote Originally Posted by Darrell456 View Post
    However, I need to be able to click on the row then click the button and the entire row change that color.
    When you post any lines of code within the forum, please use the code tags (# button) to demark your lines of code.

    Try using this line instead :
    Please Login or Register  to view this content.
    HTH

    DominicB
    Please familiarise yourself with the rules before posting. You can find them here.

  4. #4
    Registered User
    Join Date
    12-12-2009
    Location
    Dallas, TX
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: How do I program a button that changes entire row to a certain color?

    Hi and thanks VERY much. That did it!!!!!

    Is there a way that when the line is highlighted the grid lines and columns do not disappear? It just shows the entire line as a solid color. Not a big deal though.

    Thanks again!!!

  5. #5
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    Win10/MSO2016
    Posts
    12,964

    Re: How do I program a button that changes entire row to a certain color?

    Add a new line after the previous one:
    Please Login or Register  to view this content.
    At the end of the line, enter a period and notice the dropdown box.
    Select CELL.
    Type a period, select borders [period], colorindex [=some number].

    Experiment...
    Ben Van Johnson

  6. #6
    Registered User
    Join Date
    12-12-2009
    Location
    Dallas, TX
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: How do I program a button that changes entire row to a certain color?

    Here is another newb question.

    I programed the buttons with the code. However when I save the workbook:

    "The following features cannot be saved in Macro free workbooks"

    How do I change this? Obviously I have no clue what im doing.

  7. #7
    Registered User
    Join Date
    12-12-2009
    Location
    Dallas, TX
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: How do I program a button that changes entire row to a certain color?

    Nevermind I figured it out. I wonder if once I put this on my computers at work will it give the Security warning each time its open as to the Macros???

  8. #8
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Smile Re: How do I program a button that changes entire row to a certain color?

    Hi Darrell456
    Quote Originally Posted by Darrell456 View Post
    Nevermind I figured it out. I wonder if once I put this on my computers at work will it give the Security warning each time its open as to the Macros???
    Yes, it will. This is just Microsoft's security thing. There is one thing you can do to get rid of it but I wouldn't recommend it.

    If you were to go to Tools > Macro > Security and set your security level to "Low". This will mean that all macros could be run on your machine, without you even knowing a workbook contained macros. As I say, it's not recommended ...

    HTH

    DominicB

+ 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