+ Reply to Thread
Results 1 to 7 of 7

Require Double Left Click to Enter Data Into Cell

  1. #1
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Require Double Left Click to Enter Data Into Cell

    Hi...I've wrestled with the title of this thread. What I'd like to do is to require the User to double left click on a cell in a given range in order to enter data. If the user TYPES in that cell, they would get a message.

    In the attached, if the User were to double left click on a cell in Column B, it'll bring up a Calendar from which the User can select a date. The date will then populate the active cell.

    The issue I have is that the user CAN type anything into the active cell. I'd like to prevent this. So, if the User sends ANY keystrokes other than "Left Double Click" they'd get a message such as "Please Double Click To Bring Up Calendar".

    I've been at this for some time now and haven't figured out a workable solution.

    Sorry, the file seems to be too large to upload in native state.
    Attached Files Attached Files
    Last edited by jaslake; 02-28-2011 at 12:32 AM.
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,336

    Re: Require Double Left Click to Enter Data Into Cell

    Hi John,

    Why not just do a Validation Rule where the Date needs to be between two ranges. When then enter anything but your date, you can specify the error message using Data Validation. You will be able to double clidk and bring up your calendar and put in values but an entry of anything except a date will give the message.

    I couldn't open your file.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,336

    Re: Require Double Left Click to Enter Data Into Cell

    Hi,
    Find the attached, as my motto is 'One test is worth a lot of opinions' Look at Col A for about 10 rows.

    This has Data Validation on the cells in Column A. I've named the range so the Data Validation rules are easier. If you don't enter a date you can put any message you want in the data validation dialog...

    Then there is a userform with the Date Time Picker on it... DTPicker from Microsoft.

    The UserForm is shown with a double click in the range, see the code behind the worksheet. This shows the Userform with the DTPicker. Click on the OK button and it puts the DTPicker's date in the cell that you just double clicked.

    I have no idea how I know this stuff. Quesions?

    Hope this helps.
    Attached Files Attached Files

  4. #4
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Require Double Left Click to Enter Data Into Cell

    Hi MarvinP

    Appreciate your input. However, your suggested approach has similar limitations to other approaches I've tried. It'll allow any numeric entry which is, in tum, interpreted as a date. I'd like the user to not be able to enter ANY data EXCEPT from the Calendar so as to avoid entering incorrect data. If the user choses a bad date from the Calendar, so be it.

  5. #5
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,336

    Re: Require Double Left Click to Enter Data Into Cell

    Hey John,
    In the Data Validation you can enter a date range that will keep most bad data from being entered. I had set it to a date after, but you can set it for BETWEEN two dates. So if you were only allowing invoices from 2010 and 2011 you could set those ranges. It will barf if a date is entered outside that range.

    I'm thinking that is about as good as I can do.

  6. #6
    Registered User
    Join Date
    04-14-2010
    Location
    NZ
    MS-Off Ver
    2007,2010
    Posts
    86

    Re: Require Double Left Click to Enter Data Into Cell

    An idea i had - using a global boolean type variable (not ideal i know)

    something like:
    Please Login or Register  to view this content.

  7. #7
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Require Double Left Click to Enter Data Into Cell

    Hi Deamo

    Well you're "idea" does the job. I don't have an issue with
    using a global boolean type variable
    That's why God or (Mr. Gates) made 'em.

    Had to make a sleight adjustment to my Calendar Click macro
    Please Login or Register  to view this content.
    but, with that modification, things work as expected.

    Thanks.

+ 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