Results 1 to 6 of 6
  1. #1
    Star Lounger
    Join Date
    Mar 2006
    Location
    Princeton, New Jersey, USA
    Posts
    81
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Select doesn't allow me to type in cell (Excel 2003 & VBA)

    Hi All,

    I have attached a workbook with a macro that basically checks to see if A4 is/has a study number in it, if it doesn't, A4 is selected and the user can type in it.
    If the study number is okay, the user is prompted for a password and if the password is okay, then cell G10 is selected so the user can type in it. However, the user canNOT type in it unless (s)he actually clicks cell G10 and then they can type. This is the problem.

    (FYI ... this is the first time I have used a form for a password and I am using someone else's code I found ... )

    To test this (if you want):
    You can enter Nothing in A4 and you will get a message and the focus goes back to A4 so the user can type.
    Then, you can enter 77777 in A4 and click the button "Get Milestones". The user is prompted for a password ... please use: cat.
    Some rows are displayed and the focus is placed on cell G10 ... unfortunately the user cannot simply start typing.

    Any help would be appreciated ...

    Thanks,
    --cat

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Select doesn't allow me to type in cell (Excel 2003 & VBA)

    As far as I can tell, Excel doesn't always get the focus back, because you only hide the form instead of unloading it. Try the following in GetTypicalMilestones:

    'Ask for their password
    frmPassword.Show 1
    mypassword = frmPassword.txtPassword
    Unload frmPassword

  3. #3
    Gold Lounger
    Join Date
    Feb 2004
    Location
    Cape Town, RSA
    Posts
    3,444
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Select doesn't allow me to type in cell (Excel 2003 & VBA)

    The display alerts line must be commented out. If you run the macro, press debug when the macro fails. You will see it selects the Application.displayalerts=true. This line must be commented out by putting a ( ' ) single apostrophe infront of the line. (You can also delete it if you want)

    The macro runs fine atfer doing this!
    Regards,
    Rudi

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Select doesn't allow me to type in cell (Excel 2003 & VBA)

    I don't think DisplayAlerts has anything to do with it, and commenting it out doesn't work for me (or rather, it works the first time, but not if you click the button a second time)

  5. #5
    Star Lounger
    Join Date
    Mar 2006
    Location
    Princeton, New Jersey, USA
    Posts
    81
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Select doesn't allow me to type in cell (Excel 2003 & VBA)

    Thank you, Hans. That worked! I didn't even know that I was hiding something!

  6. #6
    Gold Lounger
    Join Date
    Feb 2004
    Location
    Cape Town, RSA
    Posts
    3,444
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Select doesn't allow me to type in cell (Excel 2003 & VBA)

    I notice now yes....after your message to me, I went into the file again and it debugged on another line!
    Sorry....I almost thought I have a solution there!!
    Regards,
    Rudi

Posting Permissions

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