Error trying to change font colour of textbox part of grouped object

Ark68

Well-known Member
Joined
Mar 23, 2004
Messages
4,570
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
I have a series of 7 grouped shapes (named: btn_svc_# respectively) object on my worksheet (using as a button) that comprises of a rounded rectangles (named: srv_btn_# respectively) and a superimposed textbox (named: srv_tb_#) where # isolates the unique "button".

I am using this code to set the default format properties of each of the seven buttons:

Rich (BB code):
        For sbtn = 1 To 7
            ssbtn = "srv_btn_" & sbtn
            Set shp = .Shapes(ssbtn)
            With shp
                .Fill.ForeColor.RGB = vbWhite
                .Line.Weight = 0.25
                .Line.ForeColor.RGB = RGB(209, 239, 250)
            End With
            .Shapes("svc_tb_" & sbtn).Font.Color = RGB(209, 239, 250)
        Next sbtn

I am getting a "The item with the specified name wasn't found." error with the line in red.

I'm just guessing, but I might have to ungroup the grouped object to make svc_tb_# accessible? I looked, but I haven't figured out how to do that. Looking for help.
 
That's great, I'm glad you now have it working.

Yeah, sometimes it's those little details that can get you. ;)

Cheers!
 
Upvote 0

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.

Forum statistics

Threads
1,223,911
Messages
6,175,337
Members
452,637
Latest member
Ezio2866

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top