VBA For Organizing Quotes

  • This is my first attempt at a VBA and its causing me to grow gray hairs. I have a Excel Web Query downloaded to my PC from Netsuite. It has a bunch of quotes with their expected close dates. I'd like to be able to organize all the quotes by month on sheet 2 (see attached example) with a click of a button. I did a bunch of googling and was able to figure out how to only copy over one date. I would like to copy and organize all 12 months with one click. Is this possible? This my current code


  • I attached the a sample of what I need done. I need to take the quotes from sheet1 and organize/segregate them by month on sheet 2 by clicking a command button. So far, with the command i have listed I am able to only organize one date/time

  • Maybe this will work.

    It took a while as I was busy with other things.

    Jolivanes, that is exactly what I needed! Thank you so much! The only extra thing I would like to ask is I noticed it organizes it by date created. Could you point out how I could change it so that it organizes it by Expected Close Date instead?

  • Change this part

    Code
    1. For Each c In sh1.Range("B2:B" & sh1.Cells(Rows.Count, 2).End(xlUp).Row)
    2. c.Offset(, -1).Resize(, 7).Copy sh2.Cells(Rows.Count, sh2.Rows(1).Find(mnthArr(Month(c) - 1)).Column).End(xlUp).Offset(1)
    3. Next c

    to this

    Code
    1. For Each c In sh1.Range("F2:F" & sh1.Cells(Rows.Count, 6).End(xlUp).Row)
    2. c.Offset(, -5).Resize(, 7).Copy sh2.Cells(Rows.Count, sh2.Rows(1).Find(mnthArr(Month(c) - 1)).Column).End(xlUp).Offset(1)
    3. Next c


    I think I had one column too many in the code in the attachment.

    The "Resize(, 8)" should have been "(Resize(, 7)".

    If it did say "Resize(, 7)", then it was OK

  • Sir, you are awesome! It works perfectly. Thank you very much for your help it is truly appreciated! I guess my only other question is how can I learn VBA as good as you? Do you have any suggestions for me as far as where to start? Maybe courses? Please let me know.


    Thanks again!

  • Thanks for the praise but I am just a novice compared to most of the people on these forums.

    Whatever I do know about it is garnered from people that are regulars on these forums and give their free time to people that need help with their Excel problems.

    Search this forum, and maybe some others to broaden the horizon, and you'll see quite a few names pop up on a regular basis. Read their answers and learn to implement them in your work. And don't be afraid to ask for help here, even if you have a working solution already. Two or more minds know more than one.

    Good luck