If I open a form non-modally, I can't use the data in the RefEdit control. Any suggestions?
[VBA]
Private Sub CommandButton1_Click()
Dim rng As Range
Set rng = Range(RefEdit1)
MsgBox rng(2).Address
End Sub
[/VBA]
If I open a form non-modally, I can't use the data in the RefEdit control. Any suggestions?
[VBA]
Private Sub CommandButton1_Click()
Dim rng As Range
Set rng = Range(RefEdit1)
MsgBox rng(2).Address
End Sub
[/VBA]
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
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
It arose in answering this question, where user action on the sheets may be desirable
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'