+ Reply to Thread
Results 1 to 16 of 16

Put Date in Cell B when value is inserted in C, D, or E.

  1. #1
    Registered User
    Join Date
    07-01-2014
    Location
    California, USA
    MS-Off Ver
    2007, PC
    Posts
    10

    Put Date in Cell B when value is inserted in C, D, or E.

    http://www.excelforum.com/excel-gene...e-changes.html

    I got the code in the above link working for me, but how would I restrict it to a certain subset of Rows? It's overwriting headers and totals and other things I don't want to change in the worksheet.

    Thank you in advance for your help!

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Put Date in Cell B when value is inserted in C, D, or E.

    What subset do you want to restrict it to?
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    07-01-2014
    Location
    California, USA
    MS-Off Ver
    2007, PC
    Posts
    10

    Re: Put Date in Cell B when value is inserted in C, D, or E.

    Starting with Row 2 and for now through Row 40. The Row subset will grow as they fill up.

    I updated the target to include three columns (C, D, & E) and I updated the offset to (0,-1) with the hope that it would put the date in column B. It's not quite working out as hoped. Right now it works perfectly if I enter a value in Cell C (date autofills in Cell B), but if I put a value in Cell D, Cell C gets the date, and if I put the value in Cell E, Cell D gets the date. I only want Cell B to have a date in it, no matter if the value is entered in Cell C, D, or E. How do I represent the offset so that Cell B always gets the date?

    Thanks!

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Put Date in Cell B when value is inserted in C, D, or E.

    Can you post the code you are using?

  5. #5
    Registered User
    Join Date
    07-01-2014
    Location
    California, USA
    MS-Off Ver
    2007, PC
    Posts
    10

    Re: Put Date in Cell B when value is inserted in C, D, or E.

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    07-01-2014
    Location
    California, USA
    MS-Off Ver
    2007, PC
    Posts
    10

    Re: Put Date in Cell B when value is inserted in C, D, or E.

    If there was a way to get the same effect via formulas in the cells instead of a "worksheet event" as the original coder described it, I'd be really into it. It seems like that would be a more nuanced approach.

  7. #7
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Put Date in Cell B when value is inserted in C, D, or E.

    If you want the date to be static then you can't do it with formulas.

    To have the date go into column B if something is entered in columns C:E then give this a go.
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    07-01-2014
    Location
    California, USA
    MS-Off Ver
    2007, PC
    Posts
    10

    Re: Put Date in Cell B when value is inserted in C, D, or E.

    The "B" designation doesn't work (no dates appear anywhere when any cells are updated). Thanks for the try.

  9. #9
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Put Date in Cell B when value is inserted in C, D, or E.

    Works for me.

    Where are you putting the code?

  10. #10
    Registered User
    Join Date
    07-01-2014
    Location
    California, USA
    MS-Off Ver
    2007, PC
    Posts
    10

    Re: Put Date in Cell B when value is inserted in C, D, or E.

    Right click on tab, "View Code" and then pasting it in the box that shows up. Box has "Worksheet" in top left and "Change" in top right. I copied your code verbatim and overwrote the code I had in there.

  11. #11
    Registered User
    Join Date
    07-01-2014
    Location
    California, USA
    MS-Off Ver
    2007, PC
    Posts
    10

    Re: Put Date in Cell B when value is inserted in C, D, or E.

    ...and now when I copy my code back in and save, it doesn't work either! Yikes, what did I do? The file is saved as macro-enabled.

  12. #12
    Registered User
    Join Date
    07-01-2014
    Location
    California, USA
    MS-Off Ver
    2007, PC
    Posts
    10

    Re: Put Date in Cell B when value is inserted in C, D, or E.

    Okay, I got it working, including your code. Now how to restrict the target to a certain section of Rows?

  13. #13
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Put Date in Cell B when value is inserted in C, D, or E.

    What rows do you want to restrict it to?

    You mentioned the header row, which I assume would be row 1, but it's not clear what other rows you would like to exclude.

  14. #14
    Registered User
    Join Date
    07-01-2014
    Location
    California, USA
    MS-Off Ver
    2007, PC
    Posts
    10

    Re: Put Date in Cell B when value is inserted in C, D, or E.

    Starting with Row 2 and for now through Row 40. The Row subset will grow as they fill up.

  15. #15
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Put Date in Cell B when value is inserted in C, D, or E.

    This should restrict things to rows 2 to 40 in columns C:E
    Please Login or Register  to view this content.

  16. #16
    Registered User
    Join Date
    07-01-2014
    Location
    California, USA
    MS-Off Ver
    2007, PC
    Posts
    10

    Re: Put Date in Cell B when value is inserted in C, D, or E.

    Thank you for your help!

+ 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. Replies: 5
    Last Post: 10-02-2013, 09:49 AM
  2. [SOLVED] Sum in one cell after a date is inserted in another
    By Jimdock in forum Excel General
    Replies: 2
    Last Post: 07-05-2012, 05:44 AM
  3. Inserting a date modified,or date inserted row
    By komet12 in forum Excel General
    Replies: 0
    Last Post: 08-25-2011, 07:50 AM
  4. Divide date and time inserted in one cell
    By rurys in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-04-2009, 06:16 AM
  5. How to change cell colour, X no days from inserted date in Excel?
    By Bayvon in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 10-14-2005, 01:05 AM

Tags for this Thread

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