Results 1 to 6 of 6

Changing command button colors using variables

Threaded View

  1. #1
    Forum Contributor
    Join Date
    04-21-2007
    Location
    Lima, Peru
    MS-Off Ver
    2000, 2007, 2010
    Posts
    674

    Changing command button colors using variables

    Hi

    I have been trying to use VBA to change the color of a set of command buttons using variables rather than individually in code. Individually no problem using
    ActiveSheet.CB1.BackColor = RGB(x, y, z)
    where CB1 is the button.

    I can change the color of Excel shapes with variables using the following syntax
    ActiveSheet.Shapes("Shape" & a).Fill.ForeColor.RGB = RGB(x, y, z)
    however changing command buttons using this syntax does not work, surprisingly it does not give an error but does not change anything either.

    Using variants of both code segments I have tried as many as I can find and so far have been unable to achieve the color change.

    If anyone has any pointers they can give me it would be much appreciated.

    Many thanks

    Jeff
    Last edited by solnajeff; 08-10-2010 at 11:27 AM.

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