+ Reply to Thread
Results 1 to 5 of 5

Trapping Cell Input BEFORE Cell Updates

  1. #1
    Forum Contributor
    Join Date
    10-25-2010
    Location
    Phoenix, Arizona, USA
    MS-Off Ver
    O365
    Posts
    202

    Question Trapping Cell Input BEFORE Cell Updates

    Greetings,

    I have a Worksheet that provides a cell for the user to enter a Date/Time.

    The cell is formated as Date/Time.

    I've had some feedback from users that it would be nice just to enter the time without a semi-colon to obtain the current date + the time they entered.

    For instance, if they enter 2115, the cell would show the current date with time of 21:15,
    i.e. 10/31/2011 21:15.

    My problem is that if they enter 2115, the cell updates and formats the contents to 10/15/1905 00:00, THEN calls the WORKSHEET CHANGE event.

    Is there a BEFORE CHANGE event that isn't documented?

    Any other solutions?
    Last edited by PosseJohn; 10-31-2011 at 04:24 AM.

  2. #2
    Forum Expert
    Join Date
    03-31-2009
    Location
    Barstow, Ca
    MS-Off Ver
    Excel 2002 & 2007
    Posts
    2,164

    Re: Trapping Cell Input BEFORE Cell Updates

    There is no BeforeChange event.
    If I was doing this, I would format the cell as "Text" and have Worksheet_Change() put the value back as text that looks like a date.

    Please Login or Register  to view this content.
    Foxguy

    Remember to mark your questions [Solved] and rate the answer(s)
    Forum Rules are Here

  3. #3
    Forum Contributor
    Join Date
    10-25-2010
    Location
    Phoenix, Arizona, USA
    MS-Off Ver
    O365
    Posts
    202

    Re: Trapping Cell Input BEFORE Cell Updates

    Your response allowed me to further my code. Here's what I ended up with...

  4. #4
    Forum Contributor
    Join Date
    10-25-2010
    Location
    Phoenix, Arizona, USA
    MS-Off Ver
    O365
    Posts
    202

    Thumbs up Re: Trapping Cell Input BEFORE Cell Updates

    Sorry

    Here's what I ended up with...

    Please Login or Register  to view this content.
    Thank again for the response.

  5. #5
    Forum Expert
    Join Date
    03-31-2009
    Location
    Barstow, Ca
    MS-Off Ver
    Excel 2002 & 2007
    Posts
    2,164

    Re: Trapping Cell Input BEFORE Cell Updates

    I strongly recommend that you Name $F$3 something. At a later date you may wish to redesign the sheet and move $F$3 to some other place. If the macro is looking for $F$3 then it will crash when the cell is moved. But if the cell is Named "Date", or "RptDate" or anything and the macro is looking for Range("Date") instead of Range("F3") then it will still find it when the cell is moved.

+ 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