+ Reply to Thread
Results 1 to 6 of 6

Focus activecell after display of modeless userform

  1. #1
    Forum Contributor
    Join Date
    08-21-2008
    Location
    Hamilton, New Zealand
    MS-Off Ver
    Office 2007
    Posts
    255

    Focus activecell after display of modeless userform

    I am using a technique to display a modeless userform to display to the user that the cell data validation has failed (or not) after checking cell data entry (with checks coded as required).

    I am using this method for a number of reasons -
    - enables more flexibility and more characters over that of in cell data validation error messages
    - to reduce repeat of validation data (to reduce file size) as worksheet has large qty of rows with large qty of columns with variation of validation requirements for each column.

    But in the event that data is invalid (fails validation), once the modeless userform is displayed, i want the focus to be on the current cell, not the userform, otherwise the user will always have to click the worksheet to to get focus to enable entry to cell of corrected data.

    Any solutions would be much appreciated
    Last edited by wotadude; 05-08-2009 at 08:37 PM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Focus activecell after display of modeless userform

    Not sure, it might help to see your code. maybe
    Please Login or Register  to view this content.
    Last edited by royUK; 05-08-2009 at 05:34 AM.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Contributor
    Join Date
    08-21-2008
    Location
    Hamilton, New Zealand
    MS-Off Ver
    Office 2007
    Posts
    255

    Re: Focus activecell after display of modeless userform

    tried the activecell.activate approach.
    With no success.
    The issue ocurrs when userform is first shown.

    refer attached sample file.
    Currently the validation is performed by in cell data validation. With input and error messages referenced form cells in row 1 of respective column.
    But data validation and text will eventually be coded in vba

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Focus activecell after display of modeless userform

    I'm not too sure what you want, but don't show the form unless the cell has an entry in it
    Please Login or Register  to view this content.

  5. #5
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,434

    Re: Focus activecell after display of modeless userform

    Use

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Cheers
    Andy
    www.andypope.info

  6. #6
    Forum Contributor
    Join Date
    08-21-2008
    Location
    Hamilton, New Zealand
    MS-Off Ver
    Office 2007
    Posts
    255

    Re: Focus activecell after display of modeless userform

    Thanks Andy, that gives the result i need.
    Much appreciated.

+ 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