Results 1 to 6 of 6
  1. #1
    3 Star Lounger
    Join Date
    Oct 2004
    Location
    USA
    Posts
    223
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Change Button text color (2000 sp3)

    Late in the day before a long weekend... brain fried... can't figure out how to change the color of the text in an ActiveX button control on a sheet in Excel. I tried:
    Sheets("Sheet1").Shapes("btnMenu").Fill.ForeColor = &H80000011
    and I tried:
    Sheets("Sheet1").Shapes("btnMenu").Fill.ForeColor .schemecolor = 44

    Both execute with no effect on the color of the text. I can see the Forecolor property in the properties box and can change it but I can't record it.
    Help!!

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Change Button text color (2000 sp3)

    Where are you doing this? In the worksheet module for Sheet1 you can use

    Me.btnMenu.ForeColor = vbRed

  3. #3
    3 Star Lounger
    Join Date
    Oct 2004
    Location
    USA
    Posts
    223
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Change Button text color (2000 sp3)

    I'm doing it in the Workbook_Open procedure.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Change Button text color (2000 sp3)

    Try

    Worksheets("Sheet1").btnMenu.ForeColor = ...

    (If you're setting it in the Workbook_Open procedure, why not set it in design view?)

  5. #5
    3 Star Lounger
    Join Date
    Oct 2004
    Location
    USA
    Posts
    223
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Change Button text color (2000 sp3)

    Hans, you are a life saver! That works like a charm.
    I need to set the color based on something I can't check until the program opens.

    I didn't know I could address controls that way. It looks like the kind of code used in the userform modules. That could make a whole lot of things I'm doing easier.

    Thanks again, and again!

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Change Button text color (2000 sp3)

    Glad it worked. Note for others: you can only use this syntax for controls from the Control Toolbox, not for controls from the Forms toolbar.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •