A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Hi headlydotcom,
In my code, replace:
.FontStyle = "Arial"
with:
.Name = "Arial"
===
Regards,
Norman
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
In Excel, I have 25 sheets with 1-2 buttons each. These are the buttons I get from the Developer Tab > Insert > Command Button (not activex) and assign to macros.
I need to loop through every button on every sheet and change the font size to 8 points and arial, can anyone give me the code to accomplish this? TIA
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
Answer accepted by question author
Hi headlydotcom,
In my code, replace:
.FontStyle = "Arial"
with:
.Name = "Arial"
===
Regards,
Norman
Answer accepted by question author
Hi headlydotcom,
In Excel, I have 25 sheets with 1-2 buttons each. These are the buttons I get from the Developer Tab > Insert > Command Button (not activex) and assign to macros.
I need to loop through every button on every sheet and change the font size to 8 points and arial, can anyone give me the code to accomplish this? TIA
Try something like:
'=========>>
Option Explicit
'--------->>
Public Sub Tester()
Dim WB As Workbook
Dim SH As Worksheet
Dim Btn As Button
Set WB = ThisWorkbook
For Each SH In WB.Worksheets
For Each Btn In SH.Buttons
With Btn.Font
.Size = 8
.FontStyle = "Arial"
End With
Next Btn
Next SH
End Sub
'<<=========
===
Regards,
Norman