+ Reply to Thread
Results 1 to 3 of 3

Date picker cell

  1. #1
    Forum Contributor
    Join Date
    05-13-2013
    Location
    Swindon UK
    MS-Off Ver
    Excel 2010
    Posts
    287

    Date picker cell

    HI Can anyone help

    I have a workbook with a date picker in a few cells with code, all works perfect, however when I click on the cell I can input any data and when I click out of the cell it errors out.

    if I click on the data picker dates its all ok.

    What I would like to do is lock the cell so only a date from the date picker will be shown, or even a msb box saying input error please input correct date


    Can anyone help me on theis. Here is the code that im using


    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Date picker cell

    One trick I have employed to prevent the user being able to edit the cell directly:
    - insert an active-x Label
    - position it over the cell
    - make it the same size as the cell
    - make it transparent
    - make it move and resize with the cell

    Then to amend the cell value
    - attach a click event macro to the Label which triggers your date picker
    Click *Add Reputation to thank those who helped you. Ask if anything is not clear

  3. #3
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Date picker cell

    Here is a carrot for donkey

    Attached is simple example of blocking direct edit of a cell
    - the cell is named Cell_1 using a named range
    - avoids risk of rows or columns being inserted and changing the cell reference
    - a message pops up when user clicks on cell
    (in fact user is clicking on transparent label)
    - the event macro moves\sizes the label in line with the cell
    (I would not necessarily trigger it by every SelectionChange event - but the code is useful and the label must move when rows are inserted etc)

    The protected cell in the attached workbook is cell D2

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by kev_; 02-24-2018 at 03:08 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Date picker within each cell question?
    By Johnny247 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-09-2016, 01:56 PM
  2. Date picker within each cell?
    By loccy in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 10-09-2016, 12:42 PM
  3. Replies: 0
    Last Post: 08-01-2015, 12:29 AM
  4. [SOLVED] Using date picker for specific cell
    By skhari in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-08-2015, 04:25 PM
  5. [SOLVED] Date Picker in UserForm will not add value to specified cell
    By clapforthewolfman in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-04-2013, 01:18 PM
  6. How to format a cell to date picker?
    By Driaan in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-16-2013, 06:25 AM
  7. Still need help: Selecting next cell with Date Picker
    By BuzzT in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-30-2010, 02:49 PM

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