+ Reply to Thread
Results 1 to 15 of 15

VBA Code not arranging End Result in Sequence and Adding 15 Man Days to a Date

  1. #1
    Registered User
    Join Date
    04-07-2015
    Location
    Hyderabad, India
    MS-Off Ver
    2010
    Posts
    19

    Thumbs up VBA Code not arranging End Result in Sequence and Adding 15 Man Days to a Date

    Hi

    The below code does what I need it to do but it requires small tweaks / code cleanup maybe

    Issues:
    1. The fetched results from two different sheets is arranged alternatively. But I wish to have the data from one sheet all stacked in sequence and then followed by the data of the second sheet. I'm sure a code optimization is required here but since I'm a beginner unable to do so

    2. Also I need the code to ' Copy Planned Closure Date where Date located in Sheet 2(7 Row, 5 Column)and add 15 Man Days to it and place data in Sheet 13 and in Column 8 (The same has been commented in the code)

    Below is the Code
    Please Login or Register  to view this content.
    Last edited by Zatin; 03-10-2018 at 07:31 AM.

  2. #2
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,100

    Re: VBA Code not arranging End Result in Sequence and Adding 15 Man Days to a Date

    in the 2 loops it seems you copy same data every time, reasen for this ?

    Kind regards
    Leo

  3. #3
    Registered User
    Join Date
    04-07-2015
    Location
    Hyderabad, India
    MS-Off Ver
    2010
    Posts
    19

    Re: VBA Code not arranging End Result in Sequence and Adding 15 Man Days to a Date

    Hi,

    I do that since I need all the "No" rows from two different sheets of the same workbook.

    1st loop searches for "No" in sheet 4 and

    2nd loop searches for "No" in Sheet 11.

    Initially I had the code working for Sheet 4 and later I had to fetch values from Sheet 11 too. So I just replicated the code.

  4. #4
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,100

    Re: VBA Code not arranging End Result in Sequence and Adding 15 Man Days to a Date

    search for "No" in sheet 4 and 11
    but copy every time same data from sheet 2
    so 30 times No gives you 30 rows with same data

    Kind regards
    Leo

  5. #5
    Registered User
    Join Date
    04-07-2015
    Location
    Hyderabad, India
    MS-Off Ver
    2010
    Posts
    19

    Re: VBA Code not arranging End Result in Sequence and Adding 15 Man Days to a Date

    Well, As I mentioned I'm a starter to VBA and I tried using "And" statement in the first loop code line 1

    Please Login or Register  to view this content.
    But it did not work.

    Thanks!
    Zatin

  6. #6
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,100

    Re: VBA Code not arranging End Result in Sequence and Adding 15 Man Days to a Date

    it is not the "No", it is the data you need in sheet 13

    in your code if there is "No" you copy same data from sheet 2 again and again

  7. #7
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,100

    Re: VBA Code not arranging End Result in Sequence and Adding 15 Man Days to a Date

    best thing to do, post your file with exemple of expected result

    Cheers
    Leo

  8. #8
    Registered User
    Join Date
    04-07-2015
    Location
    Hyderabad, India
    MS-Off Ver
    2010
    Posts
    19

    Re: VBA Code not arranging End Result in Sequence and Adding 15 Man Days to a Date

    Ok I think I'm lost here. Right now the code works as intended. The issue is the data from Sheet 4 and Sheet 11 are displayed alternatively in destination sheet 13. I was looking at how the data from Sheet 4 is displayed first then followed by data from sheet 11.

    I hope I explained it right.

    Appreciate your time

    Zatin

  9. #9
    Registered User
    Join Date
    04-07-2015
    Location
    Hyderabad, India
    MS-Off Ver
    2010
    Posts
    19

    Re: VBA Code not arranging End Result in Sequence and Adding 15 Man Days to a Date

    I don't see an option to attache files for I'm sharing the file on Google Drive. Sheet 13 shows what I expect.

    https://drive.google.com/file/d/1fcY...ew?usp=sharing

    Thanks!
    Last edited by Zatin; 03-08-2018 at 08:24 AM.

  10. #10
    Registered User
    Join Date
    04-07-2015
    Location
    Hyderabad, India
    MS-Off Ver
    2010
    Posts
    19

    Re: VBA Code not arranging End Result in Sequence and Adding 15 Man Days to a Date

    Ok, the Go Advance has the attachment option but it fails to work for some reason.

  11. #11
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,100

    Re: VBA Code not arranging End Result in Sequence and Adding 15 Man Days to a Date

    The date here should be C13 + 15 Man Days
    in C13 i see March'18
    what kind result do you expect here ???

    Cheers
    Leo

  12. #12
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,100

    Re: VBA Code not arranging End Result in Sequence and Adding 15 Man Days to a Date

    So no idea for Column H, others with this

    Please Login or Register  to view this content.
    kind regards
    Leo

  13. #13
    Registered User
    Join Date
    04-07-2015
    Location
    Hyderabad, India
    MS-Off Ver
    2010
    Posts
    19

    Re: VBA Code not arranging End Result in Sequence and Adding 15 Man Days to a Date

    Thanks Leo! The sequence is sorted!

    Regarding the Planned Closure Date I need to Add 15 Man Days to the date available originally in Overview sheet Cell: E7

    And place it in Sheet 13 Column H

    Thanks Again!

  14. #14
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,100

    Re: VBA Code not arranging End Result in Sequence and Adding 15 Man Days to a Date

    With Coluumn H

    Please Login or Register  to view this content.
    Kind regards
    Leo

  15. #15
    Registered User
    Join Date
    04-07-2015
    Location
    Hyderabad, India
    MS-Off Ver
    2010
    Posts
    19

    Re: VBA Code not arranging End Result in Sequence and Adding 15 Man Days to a Date

    Perfect Leo! Thank you to bear with me on this and help me out with a solution. Have a perfect weekend.

    I'm not sure if I can ask you to look into another thread I posted before this one. Since posting it I managed to resolve 4 of my 5 issues I had originally. But the biggest of the concern is still nagging me since a week. I'll give you the link below if you think right to have a look.
    https://www.excelforum.com/excel-pro...ml#post4858749

+ 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