Sourcing RefEdit events

mikerickson

MrExcel MVP
Joined
Jan 15, 2007
Messages
23,910
If I want a variable to source events from a userform's textbox, I would use
Code:
 Public myTextBox as msForms.TextBox
.

What class would I use to source events from a RefEdit control?

There is no msForms.RefEdit class.

Thanks.

(Yes, I know they are buggy as all get out. :) )
 

Some videos you may like

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.

MarcelBeug

Well-known Member
Joined
Apr 25, 2014
Messages
1,811
This works with me:
Code:
Sub testRefEdit()

Dim myRefEdit As RefEdit.RefEdit

Set myRefEdit = UserForm1.RefEdit1


End Sub
 

mikerickson

MrExcel MVP
Joined
Jan 15, 2007
Messages
23,910
I get a "User defined type not defined" error.
I guess my Mac (Excel 2011) doesn't have the RefEdit library. (2004 did).
 

MarcelBeug

Well-known Member
Joined
Apr 25, 2014
Messages
1,811
My Windows 8.1 laptop has, i.e. once I create a userform with a RefEdit control, I have RefEdit in my Object Browser, refering to:
C:\Program Files\Microsoft Office 15\Root\Office15\REFEDIT.DLL
 

mikerickson

MrExcel MVP
Joined
Jan 15, 2007
Messages
23,910
Does that source events?
If you put Public WithEvents myRE as RefEdit.RefEdit in a Class Module, does the drop down give you the option for myRE events?
 

MarcelBeug

Well-known Member
Joined
Apr 25, 2014
Messages
1,811
Does that source events?
If you put Public WithEvents myRE as RefEdit.RefEdit in a Class Module, does the drop down give you the option for myRE events?
It does, but first after adding the reference "RefEdit Control", either via Tools - References or by creating a form with a RefEdit control.
 

Watch MrExcel Video

Forum statistics

Threads
1,122,694
Messages
5,597,571
Members
414,156
Latest member
WDMix

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
Top