+ Reply to Thread
Results 1 to 5 of 5

Lock Cell Date Format NOT Content

Hybrid View

mlmaclean Lock Cell Date Format NOT... 09-18-2009, 08:59 AM
Palmetto Re: Lock Cell Date Format NOT... 09-18-2009, 09:57 AM
mlmaclean Re: Lock Cell Date Format NOT... 09-18-2009, 10:22 AM
mlmaclean Re: Lock Cell Date Format NOT... 09-18-2009, 12:06 PM
alepsh Re: Lock Cell Date Format NOT... 12-30-2010, 08:00 AM
  1. #1
    Registered User
    Join Date
    09-10-2009
    Location
    Halifax, Nova Scotia
    MS-Off Ver
    Office 2000 (Work), Office 2003 & 2007 (Home)
    Posts
    6

    Exclamation Lock Cell Date Format NOT Content

    I have a workbook that my employees are required to update. HOWEVER, there seems to be some trouble keeping the same date format. Rather than including instructions on how to input the date, is there a way to have my employees enter the date in whatever form they choose and it transform into my preferred format?

    I want it always to appear as dd-mmm-yy

    Many thanks!
    Last edited by mlmaclean; 09-18-2009 at 12:34 PM. Reason: one more question...

  2. #2
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Lock Cell Date Format NOT Content

    How about using a Calendar Control to let them pick the date so that you always get a valid date in the desired format?

    See attached.

    Calendar Code:
    Option Explicit
    
    Private Sub Calendar1_Click()
    
        ActiveCell.Value = Format(Me.Calendar1.Value, "dd-mm-yy")
    
    End Sub
    
    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
        
        If Not Intersect(Target, Range("A10:A100")) Is Nothing Then
            Me.Calendar1.Visible = True
        Else
            Me.Calendar1.Visible = False
        End If
    
    End Sub
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    09-10-2009
    Location
    Halifax, Nova Scotia
    MS-Off Ver
    Office 2000 (Work), Office 2003 & 2007 (Home)
    Posts
    6

    Re: Lock Cell Date Format NOT Content

    Yes... That's what I was thinking too...

    Thanks for the code... I'll try it out...

  4. #4
    Registered User
    Join Date
    09-10-2009
    Location
    Halifax, Nova Scotia
    MS-Off Ver
    Office 2000 (Work), Office 2003 & 2007 (Home)
    Posts
    6

    Re: Lock Cell Date Format NOT Content

    If I want to add it to a new worksheet - I understand I have to create my own user form, but... am I missing something obvious for the ability to click on the cell and make it happen?

  5. #5
    Registered User
    Join Date
    12-30-2010
    Location
    Israel
    MS-Off Ver
    Excel 2003
    Posts
    1

    Re: Lock Cell Date Format NOT Content

    Hi, i tried to use your example xls file, but i have an error message:


    ---------------------------
    Microsoft Visual Basic for Applications
    ---------------------------
    Compile error:

    Method or data member not found
    ---------------------------
    OK Help
    ---------------------------

    What i need to do ?

    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