Consulting

Results 1 to 3 of 3

Thread: RefEdit in non-modal form

  1. #1
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location

    RefEdit in non-modal form

    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'

  2. #2
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,726
    Location
    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

  3. #3
    Administrator
    VP-Knowledge Base VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    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'

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •