+ Reply to Thread
Results 1 to 5 of 5

VBA syntax that will read date and time, and return a letter for the corresponding shift

  1. #1
    Registered User
    Join Date
    09-06-2021
    Location
    Jefferson City, Missouri
    MS-Off Ver
    Microsoft Office Professional Plus 2019
    Posts
    3

    VBA syntax that will read date and time, and return a letter for the corresponding shift

    Attached is an example of how the shifts will change. All shifts work rotate days and nights. For example a shift coming in 9/6/2021 will work 07:00 - 19:00 call them shift A Shift B works 9/6/2021 from 19:00 to 9/7/2021 they shifts also alternate day and night every two weeks.

    I would like some suggestions on how to make this work since the shift extends into the next day and they alternate every two weeks. I appreciate any help thank you
    Attached Files Attached Files

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,164

    Re: VBA syntax that will read date and time, and return a letter for the corresponding shi

    Hi etm4y8 and welcome to the forum,

    Could you go over your example to insure it is correct? Are people assigned to A and B shifts so you could say Bob and Sally are on A shift and Fred and Sam are B shift? I just couldn't make your example in the attached rotate at 2 weeks.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    09-06-2021
    Location
    Jefferson City, Missouri
    MS-Off Ver
    Microsoft Office Professional Plus 2019
    Posts
    3

    Re: VBA syntax that will read date and time, and return a letter for the corresponding shi

    Yes, but there are 4 shifts A B C D. Bob and Sally on A shift are working Day shift from 7am- 6:59 pm when Fred and Sam come in for night shift from 7pm until 6:59 am the next morning. They work Monday Tuesday and Wednesday. When Fred and Sam leave at 6:59 am on Thursday Tim and Jill from C shift come in, they alternate with Scott and Ben from D shift thursday and friday.

    Does this make sense?

  4. #4
    Registered User
    Join Date
    09-06-2021
    Location
    Jefferson City, Missouri
    MS-Off Ver
    Microsoft Office Professional Plus 2019
    Posts
    3

    Re: VBA syntax that will read date and time, and return a letter for the corresponding shi

    Im more or less looking for suggestions on how to accomplish this. The swing shift in my plant is unique since all shifts alternate to work both days and nights.

    The intended use for this is to use HMI software communicating with PLCs that will read a date and time. So the HMI should show the shift that corresponds to the date and time. So despite the fact i have people assigned to shifts, through the HMI I am not able to determine absolutely the person working.

  5. #5
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,164

    Re: VBA syntax that will read date and time, and return a letter for the corresponding shi

    Hi etm4y8,

    I'm working on your problem again and simply don't see the pattern in your example. Sorry. I'd suggest you look at your attached workbook again and see if it really states your problem correctly.

+ 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] Formula that can lookup in a table and return shift time for the specific day and name
    By Shellybelly in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 06-29-2018, 02:09 PM
  2. [SOLVED] Read Or Return Time In Displayed Format
    By OzTrekker in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-25-2016, 05:50 PM
  3. [SOLVED] match date name and specific shift and return date in other cell
    By godlev in forum Excel General
    Replies: 4
    Last Post: 06-30-2016, 05:41 AM
  4. Date time syntax query in vba
    By farrukh in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-15-2012, 03:41 AM
  5. Problem looking up shift from encoded cell with date/time?
    By bberks in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-03-2010, 03:17 PM
  6. Date/Time format syntax
    By Dennis Huber in forum Excel General
    Replies: 1
    Last Post: 05-19-2009, 12:58 PM
  7. Date and time based on shift in cell
    By Tortus in forum Excel General
    Replies: 5
    Last Post: 01-15-2009, 08:48 AM

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