+ Reply to Thread
Results 1 to 5 of 5

vba to copy a date and paste it in specific cell of another sheet

  1. #1
    Registered User
    Join Date
    03-19-2015
    Location
    Myanmar
    MS-Off Ver
    2010 Microsoft Office Excel
    Posts
    17

    vba to copy a date and paste it in specific cell of another sheet

    Hi,
    I need help for my problem.
    I am handling staff daily record and other informations. For now, I have to record daily arrival time of each staff (total 200 staff). The staff who arrive after 9:30 will be recorded as "late". But here there will be two different kind of late- personal late (recorded as pl) and on duty late (recorded as odl). In a sheet, I would record the time of his/her arrival time in colum 4 and in colum 5 write the kinds of late as pl or odl, if he/she arrived after 9:30. So, two colum will be used for one specific day with mention of a date in row 2 by merging colum 4 and 5 of row 2. Date format is 14- Feb- 15. So, colum 6 and 7 will be for 15-Feb-15 and so on. Colum 1 is Serial number, col 2 for rank grade and colum 3 the name of the staff.
    What I want to do is that
    If I enter pl or odl in a cell of Row 4 Colum 5, then run a macro to copy 14 from 14-Feb-15 and paste that number in a cell of another sheet.
    Again, if I enter another pl or odl in Row 4 Col 7 for the same staff, then copy 15 out of 15-Feb-15 and paste that number in the same cell mentioned above (it will become 14, 15).
    By doing so, I can easily check how many late on which days occur to the staff within a cell.
    May I apologize unless it is possible.
    If possible, please help me.
    [email protected]
    Htut

  2. #2
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    2,760

    Re: vba to copy a date and paste it in specific cell of another sheet

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.
    Remember to desensitize the data.

    ViewPic
    Click the * Add Reputation button in the lower left hand corner of this post to say thanks.

    Don't forget to mark this thread SOLVED by going to the "Thread Tools" drop down list above your first post and choosing solved.

  3. #3
    Registered User
    Join Date
    03-19-2015
    Location
    Myanmar
    MS-Off Ver
    2010 Microsoft Office Excel
    Posts
    17

    Re: vba to copy a date and paste it in specific cell of another sheet

    Thanks for your kindly reply,
    I live in Myanmar and so bad internet. That's why I could not reply to you immediately.

    Ok, I will attach a workbook. In Leave & Late Rec Sheet, there will be other leave records of a month for each staff. The number 13 in Casual Leave Column and 17,18 in Annual Leave Column is meant for the date of August Month. This is the way I want to see for "Date of Attending Office Late" Column.
    If I enter pl or old in the Remark columns of "Off Time Rec" Sheet, then run a macro/vba to pick up the date above respective remark column and paste it in "Date of Attending Office Late" Column of Leave & Late Rec Sheet.
    Attached Files Attached Files

  4. #4
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    2,760

    Re: vba to copy a date and paste it in specific cell of another sheet

    Your data would be very difficult to deal with for my skill level. You have merged cells which cause issues and you only have numbers 1,3 for example for the date and the word August in a cell that's merged. The way your sheet is formatted it's difficult for me to imagine how to deal with it.

    Perhaps someone else has some ideas. I apologize.

    Good Luck.

  5. #5
    Registered User
    Join Date
    03-19-2015
    Location
    Myanmar
    MS-Off Ver
    2010 Microsoft Office Excel
    Posts
    17

    Re: vba to copy a date and paste it in specific cell of another sheet

    Hello Skywriter,
    Thanks for your quick response.
    I am thinking now - what if I unmerged those cells.
    Is there any other ways to solve this?
    How about only date in those previously merged cells (after being unmerged, there will be two separate cells and I can input numbers only in those two cells)
    For example, 14 will be replaced, in place of 14-Aug-15 - removed Aug and 15.

    I am not a guru on VBA/Macro.
    I think it is possible if I put 14 only into those two cells.
    I imagine a command like,
    if pl or odl is typed in a cell of row 5, col 4, then check for the staff or something else that is constant, and copy the specific cell (14 containg cell).
    Again, check the same staff in destination sheet and paste 14 with comma. Because for each and every month, the columns are constant.
    You may understand what I would like to mean - my english is bad as I live in Myanmar.
    Thanks
    Last edited by Tet Htut Naing; 07-21-2015 at 06:54 AM. Reason: To Add

+ 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. Copy & Paste Row 3 from multiple worksheets to summary sheet if cell A3 equals a date
    By Volunteer2 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-02-2015, 12:04 PM
  2. [SOLVED] Copy row of any cell with date in the past and paste to new sheet
    By jeetamin in forum Excel Programming / VBA / Macros
    Replies: 23
    Last Post: 01-30-2014, 02:07 PM
  3. [SOLVED] copy paste entire row into a specific cell in sheet 2
    By melody10 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-29-2013, 04:40 PM
  4. Copy and paste specific range to date specific range in alternate sheet
    By alanalmarza in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-21-2013, 08:29 AM
  5. [SOLVED] Copy and paste data from sheet 2 to sheet 1 based on specific criteria on sheet 1
    By VBADUD in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-05-2012, 04:18 AM
  6. Find specific cell, copy row from several tabs and paste in summary sheet
    By helnil in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 09-11-2012, 08:16 AM
  7. Replies: 8
    Last Post: 03-01-2012, 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