Excel VBA RefEdit Control - Excel Range GUI Control

August 2017


This Control will give the user to manually select an excel range and use it properties to control selected range.
in this example we'll embed the RefEdit Control and use it to manipulate the selected range.
For more information about how to create a GUI please visit:
Excel VBA UserForm

the main UI should look like this:


to add the RefEdit control right click on the ToolBox window and follow these steps


Coding

Set Fill Color Button:
Private Sub Button1_Click()
On Error GoTo errorHandler
    Range(RefEdit1.Value).Activate
    Application.Dialogs(xlDialogPatterns).Show
    Range("a1").Activate
    RefEdit1.Value = ""
errorHandler:
    Exit Sub
End Sub

Set Text
Private Sub Button2_Click()
On Error GoTo errorHandler
    Range(RefEdit1.Value).Activate
    Application.Dialogs(xlDialogFontProperties).Show
    Range("A1").Activate
    RefEdit1.Value = ""
errorHandler:
    Exit Sub
End Sub

Related


Published by MaxStart. Latest update on May 16, 2015 at 03:59 PM by MaxStart.
This document, titled "Excel VBA RefEdit Control - Excel Range GUI Control," is available under the Creative Commons license. Any copy, reuse, or modification of the content should be sufficiently credited to CCM (ccm.net).