+ Reply to Thread
Results 1 to 10 of 10

Copy a specific range to another sheet adding all the workdays for a specific time period

  1. #1
    Forum Contributor MariaPap's Avatar
    Join Date
    10-19-2013
    Location
    Chania-Crete-Greece
    MS-Off Ver
    Excel 2003-2010
    Posts
    319

    Copy a specific range to another sheet adding all the workdays for a specific time period

    Hello

    I have a small range that i need to copy to another sheet for each working day of a time period(01/01/2014-30/04/2014) excluding weekends and holidays, adding the date in the first column of the new sheet.

    Can you help me on this?

    Thanks in advance for any assistance.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Copy a specific range to another sheet adding all the workdays for a specific time per

    Have only the header on sheet 2. Add in your holidays to the array then run the code:

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor MariaPap's Avatar
    Join Date
    10-19-2013
    Location
    Chania-Crete-Greece
    MS-Off Ver
    Excel 2003-2010
    Posts
    319

    Re: Copy a specific range to another sheet adding all the workdays for a specific time per

    Hello

    Thank you very much for the code. I have 2 issues

    1) Does not copy correct the second time

    2) Copy code,inCLUDES THE HOLIDAYS(Also if you notice i have a named range calling Holidays which is not inclunded in the code)

    Can you do anything for this?
    Attached Files Attached Files

  4. #4
    Forum Contributor MariaPap's Avatar
    Join Date
    10-19-2013
    Location
    Chania-Crete-Greece
    MS-Off Ver
    Excel 2003-2010
    Posts
    319

    Re: Copy a specific range to another sheet adding all the workdays for a specific time per

    Also i just noticed that code does not exclude weekends too!

  5. #5
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Copy a specific range to another sheet adding all the workdays for a specific time per

    1) It is copying properly for me.
    2) It removes the holidays for me in the array just fine.
    3) I have updated to exclude weekends (an oversight on my part)

    Amended code:
    Please Login or Register  to view this content.

  6. #6
    Forum Contributor MariaPap's Avatar
    Join Date
    10-19-2013
    Location
    Chania-Crete-Greece
    MS-Off Ver
    Excel 2003-2010
    Posts
    319

    Re: Copy a specific range to another sheet adding all the workdays for a specific time per

    Thank you again but does not works for me even this time.I get ALL the dates(inclunding weekends & Holidays and also in column E i get 08:00 As result for all the names except name A).

    Also. Do you have any idea for how can we use the named range(Holidays) in the code? I asked this because if we use the code for many months-years then we have to type 20-30 holidays inside the code.

    I upload again the sample workbook with the results that i get.

    Can you pls upload my sample workbook with the correct results that you get when you use your code?
    Attached Files Attached Files

  7. #7
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Copy a specific range to another sheet adding all the workdays for a specific time per

    Here you go. No weekends or listed Holidays came up on sheet 2.
    Attached Files Attached Files

  8. #8
    Forum Contributor MariaPap's Avatar
    Join Date
    10-19-2013
    Location
    Chania-Crete-Greece
    MS-Off Ver
    Excel 2003-2010
    Posts
    319

    Re: Copy a specific range to another sheet adding all the workdays for a specific time per

    Quote Originally Posted by stnkynts View Post
    Here you go. No weekends or listed Holidays came up on sheet 2.
    Yes that's it!

    But

    ..and also in column E i get 08:00 As result for all the names except name A).
    This problem still exist!

    Also

    ..Also. Do you have any idea for how can we use the named range(Holidays) in the code? I asked this because if we use the code for many months-years then we have to type 20-30 holidays inside the code.
    Any idea for this?

  9. #9
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Copy a specific range to another sheet adding all the workdays for a specific time per

    ..Also. Do you have any idea for how can we use the named range(Holidays) in the code? I asked this because if we use the code for many months-years then we have to type 20-30 holidays inside the code.
    Already did. Look at the code, it is different.

    ..and also in column E i get 08:00 As result for all the names except name A).
    They are your formulas, either fix them or if you wanted the values copied over you should have said so in the first place. You can replace this line to paste values

    Please Login or Register  to view this content.
    I am still curious what you were doing as to why it wasn't working for you but was working for me.

  10. #10
    Forum Contributor MariaPap's Avatar
    Join Date
    10-19-2013
    Location
    Chania-Crete-Greece
    MS-Off Ver
    Excel 2003-2010
    Posts
    319

    Re: Copy a specific range to another sheet adding all the workdays for a specific time per

    Quote Originally Posted by stnkynts View Post
    Already did. Look at the code, it is different.

    Sorry i didn't noticed this. You are right!

    I am still curious what you were doing as to why it wasn't working for you but was working for me.

    Me too!!
    Thank you for your solution and of course for your patient. Everything works fine now!

+ 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 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
  2. Counting the Number of Workdays Specific to a Month in Larger Range
    By dmbatcofc in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-11-2013, 12:28 PM
  3. Replies: 11
    Last Post: 05-20-2011, 02:09 PM
  4. Specific time period calculation from a time range
    By Khaldon in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-18-2011, 06:44 AM
  5. Adding specific value to numbers in a specific range
    By bmccarthy in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 06-17-2010, 06:12 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