+ Reply to Thread
Results 1 to 9 of 9

Datestamp an adjacent cell & not allow later alteration

  1. #1
    Forum Contributor
    Join Date
    11-13-2007
    Location
    Petersfield, Hampshire, UK
    MS-Off Ver
    MS Office for Mac ver 16
    Posts
    135

    Datestamp an adjacent cell & not allow later alteration

    I have been using the following code for some time

    Please Login or Register  to view this content.
    & it works very well, but if I lock the offset column it doesn't.

    I also want the offset cell not to be changed if the Target.Column is re-edited. Is this possible?
    Last edited by Glio; 10-09-2008 at 08:58 AM.
    Geoff Culbertson
    Petersfield, UK

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Try this
    Please Login or Register  to view this content.
    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
    11-13-2007
    Location
    Petersfield, Hampshire, UK
    MS-Off Ver
    MS Office for Mac ver 16
    Posts
    135
    Roy,
    Thanks very much for your very prompt response!

    I copied your code into Module1, Sheet1 and ThisWorkbook and could not get the code to work.
    I have tried changing the line
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.
    but this does not work either.

    Have I done something wrong?

    Regards

    Geoff

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    You need to put the code in the worksheet module, not ThisWorkBook or a standard module. Right lick the sheet tab and select View code. This will open the VB Editor. In the left hand drop down select WorkSheet. Then paste the code.

  5. #5
    Forum Contributor
    Join Date
    11-13-2007
    Location
    Petersfield, Hampshire, UK
    MS-Off Ver
    MS Office for Mac ver 16
    Posts
    135
    Roy,

    I now understand that your code is checking to see if the the 3rd cell to the right of the data input cell (in column 3) is protected, if it is, it unprotects it and is then meant to insert the date and time into that cell, before protecting it again, even if the spreadsheet is protected by password. For some reason the Date & Time is not being entered. I tried to change the Value to Now() but that doesn't work either.

    I did put your code into a Module to begin with, but when it didn't work there I tried it in the other Objects.

    Regards

    Geoff

  6. #6
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Because the default status of all cells in Excel is Locked you must first of all make sure that the date stamp cells are not Locked. Select all cells that you want the date stamp in, in this example column F, then Format menu >-Cells>-Protection and uncheck the Locked option.
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    11-13-2007
    Location
    Petersfield, Hampshire, UK
    MS-Off Ver
    MS Office for Mac ver 16
    Posts
    135
    Roy,

    Excellent that works well.
    The spreadsheet I am working on has some names in column B, which I want to protect completely. If I protect the worksheet with a password, and enter data in column C, the code demands the password before entering the date time in column F.

    Is it possible to do this by altering your code?

    Regards

    Geoff

  8. #8
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Try this amended code, remember to put your password where indicated

    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    11-13-2007
    Location
    Petersfield, Hampshire, UK
    MS-Off Ver
    MS Office for Mac ver 16
    Posts
    135
    Roy,

    Many, many thanks.


    Geoff

+ 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. Return Text in Adjacent Cell
    By Jungilingus in forum Excel General
    Replies: 1
    Last Post: 04-05-2008, 04:07 PM
  2. Inserting a row does not increment reference in cell
    By diguerd in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-15-2008, 01:26 PM
  3. Replies: 2
    Last Post: 03-07-2008, 08:05 PM
  4. Cell linked to a "wandering" cell
    By BigKahuna in forum Excel General
    Replies: 1
    Last Post: 02-29-2008, 12:27 PM
  5. Formatting Cell Fill Based on Adjacent Value
    By bmossman in forum Excel General
    Replies: 2
    Last Post: 11-22-2006, 02:44 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