Changing a button's text

nigelandrewfoster

Well-known Member
Joined
May 27, 2009
Messages
747
Two quick queries:
The following code changes the active printer, but leaves the text of button 113 unchanged, but I don't know why.:
Code:
Sub PrinterChange()
    Dim p As String, q As String
    Select Case Application.ActivePrinter
        Case "PrimoPDF on Ne00:": p = "HP lasejet on Ne04:": q = "HP"
        Case "HP lasejet on Ne04:": p = "\\IBM\OKI C3200 on Ne06:": q = "OKI"
        Case "\\IBM\OKI C3200 on Ne06:": p = "PrimoPDF on Ne00:": q = "PDF"
    End Select
[B]    Worksheets("Standing Orders").Shapes("Button 113").Select[/B]
[B]    Selection.Characters.Text = q[/B]
    Application.ActivePrinter = p
End Sub

Also, if I change the highlighted lines to
Code:
[B] Worksheets("Standing Orders").Shapes("Button 113").[/B][B]Characters.Text = q[/B]
it tells me the object doesn't support this property or method?
Thanks,
Nigel
 
Last edited:

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Hi Nigel

Another option:

Code:
Worksheets("Standing Orders").Buttons("Button 1").Text = q
 
Upvote 0

Forum statistics

Threads
1,219,161
Messages
6,146,657
Members
450,706
Latest member
LGVBPP

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