PDA

View Full Version : RefEdit in non-modal form



mdmackillop
03-20-2010, 06:18 AM
If I open a form non-modally, I can't use the data in the RefEdit control. Any suggestions?


Private Sub CommandButton1_Click()
Dim rng As Range
Set rng = Range(RefEdit1)
MsgBox rng(2).Address
End Sub

Paul_Hossler
03-20-2010, 03:14 PM
A guess is that the RefEdit has to be non-modal to allow you to select (point+click) a range, so the container UserForm has to be modal or Excel would get confused (as you found out)

I vaguely recall that there can only be a single non-modal form at a time, but not certain.

Why were you .Show-ing the userform using vbModeLess?

I couldn't see any advantage of doing it that way with a RefEdit control

Paul

mdmackillop
03-20-2010, 03:24 PM
It arose in answering this question (http://www.vbaexpress.com/forum/showthread.php?t=31058), where user action on the sheets may be desirable