+ Reply to Thread
Results 1 to 13 of 13

Copy a row from worksheet to another based on date occurring

  1. #1
    Registered User
    Join Date
    06-08-2013
    Location
    Oman
    MS-Off Ver
    Excel 2007
    Posts
    7

    Copy a row from worksheet to another based on date occurring

    Hello,

    I need a help in VBA/ Macros... I have an excel document where i have several sheet, each sheet related to a client tasks which needs to be done by my team. i need a Macros to copy an entire row from any of these sheets to the Tasks dashboard worksheet based on the date occurrence in the project worksheets.

    attached is the workbook, for example in the worksheet SABIS when the start date is falling within one week from today date, i want the entire row to be copied to the tasks dashboard worksheet without deleting it from SABIS.

    hope above briefing is sufficient to support me in this issue.

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,901

    Re: Copy a row from worksheet to another based on date occurring

    The following code will copy the rows automatically when you enter the date in column H. Copy the code into the code modules for worksheets "SABIS" and "CCC" (not into a regular module).
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    06-08-2013
    Location
    Oman
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Copy a row from worksheet to another based on date occurring

    Dear Mumps 1,

    Thank you very much, it is working perfectly. I’m wondering if the following could be coded as well
    1- In case a date occurred in SABIS and the row has been copied to the dashboard, is it possible to automatically delete the row from the dashboard in case the start date again got changed in the original worksheet (for example SABIS)?
    2- Is it possible to delete a row automatically in the dashboard (only) in case its status is changed to ‘’closed” in any of the worksheets (SABIS & Dashboard)?

    Regards
    Salam

  4. #4
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,901

    Re: Copy a row from worksheet to another based on date occurring

    Hello Salam. In order to do what you asked, each client task must have a unique identifier such as a 'Work Order Number' or something of that nature. It can be anything as long as it is unique for each task. Without this information, I have no way of identifying it and separating it from the other tasks on your 'Tasks Dashboard' sheet. Perhaps you can add another column which would contain this information for each task. If you can do this, please attach the revised file so that I can see what it looks like.

  5. #5
    Registered User
    Join Date
    06-08-2013
    Location
    Oman
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Copy a row from worksheet to another based on date occurring

    Hi Mumps1,

    it is OK if i utilize alphabetic with numeric identifier?

  6. #6
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,901

    Re: Copy a row from worksheet to another based on date occurring

    That's OK as long as each is unique.

  7. #7
    Registered User
    Join Date
    06-08-2013
    Location
    Oman
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Copy a row from worksheet to another based on date occurring

    Sir,

    Attached is the sheet updated based on your request.

    appreciated.

  8. #8
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,901

    Re: Copy a row from worksheet to another based on date occurring

    Hi Salam. Replace the previous code in your revised file with the following and let me know if it works out for you.
    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    06-08-2013
    Location
    Oman
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Copy a row from worksheet to another based on date occurring

    Hi Mumps,

    basically it is working with some snags, don't know if these issues are easy to be done or not. however if you feel that my requirements will be giving you bad time then ignore it.

    here is the result of the test

    - If i insert a date which is before today date in SABIS, the row is getting copied to the dashboard
    - If i change the date several time within the 7 days range in SABIS, the row is getting copied to the dashboard several time as well
    - If i delete the date in the SABIS, the row is getting copied in the dashboard
    - while changing the status in Sabis to closed, the row is getting deleted in the dashboard. but if again you change the status to started for example in SABIS for the same row it's not getting copied
    - If by mistake you delete the row in the dashboard it's not getting copied automatically

  10. #10
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,901

    Re: Copy a row from worksheet to another based on date occurring

    Hi Salam. Try the following code in each of the two worksheets. I believe that I have corrected the problems but it is best if you try it out and let me know how things go.
    Please Login or Register  to view this content.

  11. #11
    Registered User
    Join Date
    06-08-2013
    Location
    Oman
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Copy a row from worksheet to another based on date occurring

    Hi Mumps,

    So far so good, it's piece of art. appreciate all the effort you have provided and the professional work. i'll tested for the coming couple of days and let you know the result.

  12. #12
    Registered User
    Join Date
    06-08-2013
    Location
    Oman
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Copy a row from worksheet to another based on date occurring

    Hi Mumps.

    it's working as needed, wonderful... i need another coding for a sheet, i was trying to search in the posts but didn't find something similar to my requirements. well my document is consisting of one worksheet only. i need the rows to be shifted up and down based one the date we insert in each row.

    attached is a sample with proper dates. what i need is for example if i change the date in row 6 to be 11 May i want the row to be shifted to be after 10 may. if possible also for the formula at the the balance column to be updated that will be great.
    Attached Files Attached Files

  13. #13
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,901

    Re: Copy a row from worksheet to another based on date occurring

    Hi Salam. Place this code into the worksheet code module:
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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