+ Reply to Thread
Results 1 to 7 of 7

Input box not allowing mouse clicks

Hybrid View

  1. #1
    Valued Forum Contributor
    Join Date
    11-16-2004
    Location
    Devon UK
    MS-Off Ver
    2010
    Posts
    357

    Input box not allowing mouse clicks

    Sorry about this I am asking a lot of questions about code not working with excel 2010

    I have the code below which displays an input box asking the user to select a destination row. When used with office 2003 you could click on any row and the range was automatically filled in on the userform. When using this code on excel 2010 the userform is displayed ok but whilst the form is visible no mouse clicks (outside of the form) are accepted.
    Is there a way I can modify this or if not an alternate way of the user selecting a row without having to type in its address?

     Prompt = "Select the destination Row."
        title = "Select a cell"
    
    '   Display the Input Box
        On Error Resume Next
        Set UserRange = Application.InputBox( _
            Prompt:=Prompt, _
            title:=title, _
            Default:=ActiveCell.Address, _
            Type:=8) 'Range selection
    
    '   Was the Input Box canceled?
        If UserRange Is Nothing Then
            MsgBox "Cancelled."
    Last edited by tryer; 05-01-2011 at 02:05 AM.

  2. #2
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,342

    Re: Input box not allowing mouse clicks

    hi tryer
    with the userform properties change
    showmodal=false
    to allow worksheet selections
    can you please fill in your user profile
    Location and MS version
    If the solution helped please donate to RSPCA

    Site worth visiting: Rabbitohs

  3. #3
    Valued Forum Contributor
    Join Date
    11-16-2004
    Location
    Devon UK
    MS-Off Ver
    2010
    Posts
    357

    Re: Input box not allowing mouse clicks

    Thanks Pike,

    I'm using an inputbox which I don't think I can set the properties on? However I can checnge this to a userform following your suggestion.

    Profile completed

  4. #4
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,342

    Re: Input box not allowing mouse clicks

    the userform is showing and you call the input box

    "When using this code on excel 2010 the userform is displayed ok but whilst the form is visible no mouse clicks "

    The setting are on the userform to allow the input box to work

  5. #5
    Valued Forum Contributor
    Join Date
    11-16-2004
    Location
    Devon UK
    MS-Off Ver
    2010
    Posts
    357

    Re: Input box not allowing mouse clicks

    I've re opened this thread because I'm obviously not getting something right here.
    When I set the showmodal = false then as you said I can then click with the mouse however the routine continues to run rather than wait for an input.

    What I need is a box to display asking the user to select a row. once this selection is made I would like the row number to be available and at that point for the routine to continue.

  6. #6
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,342

    Re: Input box not allowing mouse clicks

    Hi tryer.
    Remove the "on error resume next" to see where/if there is an error
    what the complete code you are calling from the userform?

  7. #7
    Valued Forum Contributor
    Join Date
    11-16-2004
    Location
    Devon UK
    MS-Off Ver
    2010
    Posts
    357

    Re: Input box not allowing mouse clicks

    Pike, I really appreciate your help and patience here. I have (finally) solved the problem and can't believe I was so stupid. I had screen updating turned off at the begining of my code.
    I only found this out by cutting out the section of code in order to post a sample workbook for you only to find in worked OK on its own but not within my whole routine.

    Again thank you for your replies

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1