+ Reply to Thread
Results 1 to 11 of 11

VBA timestamp and value check code.

  1. #1
    Registered User
    Join Date
    11-07-2019
    Location
    Lithuania
    MS-Off Ver
    Office 2013
    Posts
    52

    VBA timestamp and value check code.

    Hello everyone,
    I was trying to figure this out, but couldn't on my own, so there is nothing for me else to do but to turn to the pros.
    I have this code which copies a template to the bottom of the active sheet from another sheet if a value is entered in column U,
    The problem is that the part which checks if it's a new lot number and the entry timestamp, only works if i enter the "Box code" value in the cell where is should be.
    To explain it simply if i enter the code in a specific cell, in column U it looks like this:
    Untitled1.png
    Result: Code is near the "box code:", G32 is marked as NEW, I32 has a timestamp, because the code was entered in U32
    If i enter the code anywhere in column U it looks like this:
    Untitled1 (1).png
    Result: Code is near the "box code:", G6 is not marked NEW, I6 doesn't have a timestamp, but I9 has, because the code was entered in U9.

    Sheet code:
    Please Login or Register  to view this content.
    A part of Module1 code:


    Please Login or Register  to view this content.
    To put it even more simply:
    How to make this:
    Please Login or Register  to view this content.
    Work after this :

    Please Login or Register  to view this content.
    Any kind of help and tips are really appreciated.

    Original post here:
    HTML Code: 
    Also posted here:
    Please Login or Register  to view this content.
    Last edited by baxius; 01-23-2020 at 10:24 AM.

  2. #2
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: VBA timestamp and value check code.

    Looking at the code, I think you may be able to add a single line here:

    Please Login or Register  to view this content.
    WBD
    Office 365 on Windows 11, looking for rep!

  3. #3
    Registered User
    Join Date
    11-07-2019
    Location
    Lithuania
    MS-Off Ver
    Office 2013
    Posts
    52

    Re: VBA timestamp and value check code.

    Please Login or Register  to view this content.
    returns an error.
    Attachment 659229
    I've managed to fix with this
    Please Login or Register  to view this content.
    But it still works only if i enter the value near where the "Box code" should be. IF i enter it anywhere else in Column U doesnt work.

  4. #4
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: VBA timestamp and value check code.

    Please attach your workbook and I'll fix it tomorrow for you.

    WBD

  5. #5
    Registered User
    Join Date
    11-07-2019
    Location
    Lithuania
    MS-Off Ver
    Office 2013
    Posts
    52

    Re: VBA timestamp and value check code.

    Thank you for your kind help.

    Workbook added.
    Attached Files Attached Files

  6. #6
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: VBA timestamp and value check code.

    See attached.

    WBD
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    11-07-2019
    Location
    Lithuania
    MS-Off Ver
    Office 2013
    Posts
    52

    Re: VBA timestamp and value check code.

    Still the same problem, if the value is not placed near "Box code:"
    The message box works fine, just the timestamp and
    Please Login or Register  to view this content.
    are not.

  8. #8
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: VBA timestamp and value check code.

    Strange. It's all working for me in the workbook I uploaded.

    WBD

  9. #9
    Registered User
    Join Date
    11-07-2019
    Location
    Lithuania
    MS-Off Ver
    Office 2013
    Posts
    52

    Re: VBA timestamp and value check code.

    Adding a test. The colour and message box are working. The timestamp stays in the row of input. See attachment. Wrote input in U50, it timestamped I50.
    Attached Files Attached Files

  10. #10
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: VBA timestamp and value check code.

    Ah. OK. Change "With Target" to "With r" in the Worksheet_Change code.

    WBD

  11. #11
    Registered User
    Join Date
    11-07-2019
    Location
    Lithuania
    MS-Off Ver
    Office 2013
    Posts
    52

    Re: VBA timestamp and value check code.

    Works perfectly, thank you for all the effort you have placed in my problem. Love you. No homo.

+ 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] VBA to timestamp and check previous value
    By baxius in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-21-2020, 12:20 PM
  2. Static timestamp using check box
    By dddavedg in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-12-2016, 05:45 AM
  3. how do I allow for 24:00 (2400) timestamp in my code ??
    By Dj Duck in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-27-2016, 08:24 PM
  4. How to check if excel file is Checked Out in SharePoing Check Out, run code, Check In
    By jrtraylor in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-08-2016, 04:36 PM
  5. Formula to check ID and timestamp against list
    By blacklotus0014 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-16-2013, 06:17 PM
  6. Check box Timestamp
    By blewbot in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-11-2010, 08:53 AM
  7. Code for a timestamp.
    By Zirus in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-15-2007, 01:10 PM

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