Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 05-22-2016, 08:59 AM
dan88 dan88 is offline Update Userform  Captions, TextBoxes, Command buttons From Excel Windows 10 Update Userform  Captions, TextBoxes, Command buttons From Excel Office 2016
Novice
Update Userform  Captions, TextBoxes, Command buttons From Excel
 
Join Date: Feb 2016
Posts: 24
dan88 is on a distinguished road
Default

Hi Graham,

with a little tweak, i have been able to get this to change the buttons on the Canvas.

It will set the actual button names in the properties.

Code:
Sub CanvasButtons()
'Graham Mayor - www.gmayor.com
Dim oFrm As New UserForm1
Dim Arr() As Variant
Dim oCtrl As Object
Dim i As Long


    Arr = xlFillArray(strWorkbook, strSheet)
    
    With ThisDocument.VBProject.vbComponents("UserForm1").Designer
      For i = 0 To UBound(Arr, 2)
            For Each oCtrl In .Controls

            If oCtrl.Name = Arr(3, i) Then
            oCtrl.Caption = Arr(4, i)
            oCtrl.Height = 100
            oCtrl.Width = 300
            oCtrl.BackColor = RGB(0, 127, 127)


            ElseIf oCtrl.Name = Arr(5, i) Then
            oCtrl.Caption = Arr(6, i)

           ' I may add lots more ElseIfs   :)

                End If
            Next oCtrl
        Next i

        '.Show
    End With
    
lbl_Exit:
    'Set oCtrl = Nothing
    Exit Sub
End Sub
Thanks Again!

Happy coding Sunday

dan

solved
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Update Userform  Captions, TextBoxes, Command buttons From Excel Captions: Changing captions in Appendix update all captions carnestw Word 3 10-27-2015 12:34 PM
Can't update/refresh embedded Excel file with Power Point 2010 command button mt1013 PowerPoint 0 06-17-2015 05:18 AM
VBA Code in a UserForm module to delete a Command Button which opens the userform Simoninparis Word VBA 2 09-21-2014 03:50 AM
UserForm Search with multiple TextBoxes johndough Excel Programming 0 05-10-2014 12:11 PM
VBA code to update record in Access 2003 using Userform in Excel primmer3001 Excel Programming 0 08-29-2011 04:25 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:10 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft