+ Reply to Thread
Results 1 to 6 of 6

VBA to sort dates and paste to summary

  1. #1
    Registered User
    Join Date
    01-27-2015
    Location
    South Africa
    MS-Off Ver
    2013
    Posts
    51

    VBA to sort dates and paste to summary

    Hi

    I have the basic setup of the millage log going, but trying to figure out how to sort the dates via VBA and paste it to the summary sheet of the workbook.

    Every vechile has its own tab, the drivers wil give me written log sheet from where I will fill in the relevant information...I want to make a button, once pressed the code should copy/paste data to the summary sheet marked in yellow.

    On the Vehicle log sheet eg (Isuzu 1) there are dates (marked in yellow) I want these dates to combine as one and paste it in the summary sheet under monthly kilometers in January.

    See attached pics and workbook
    Attached Images Attached Images
    Attached Files Attached Files

  2. #2
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,906

    Re: VBA to sort dates and paste to summary

    I think you can do this with formulas
    I just place two formulas in the summary for the isuzu 1 and in isuzu 1 sheet I placed a formula in column G that shows the month number of the date in column A (formula checks if the cell has data if not a 0 else the month number
    I also did the formumlas' to avoid Div0 that is sloppy formula work.
    See if it works for you.
    You will be busy with the others but then you do not need extra macros and so
    Attached Files Attached Files
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

  3. #3
    Registered User
    Join Date
    01-27-2015
    Location
    South Africa
    MS-Off Ver
    2013
    Posts
    51

    Re: VBA to sort dates and paste to summary

    Thank you Keebellah, I will give it a test run, and will close the tread once happy.

    Much appreciated

    Regards

  4. #4
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,906

    Re: VBA to sort dates and paste to summary

    If you get stuck, just holler.
    The keep in mind that the month value to search in the summary is taken from the header row month value

  5. #5
    Registered User
    Join Date
    01-27-2015
    Location
    South Africa
    MS-Off Ver
    2013
    Posts
    51

    Re: VBA to sort dates and paste to summary

    Quote Originally Posted by Keebellah View Post
    If you get stuck, just holler.
    The keep in mind that the month value to search in the summary is taken from the header row month value
    Thank you Keebellah, modified the code a little bit, everything working 100% now.

    Regards

  6. #6
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,906

    Re: VBA to sort dates and paste to summary

    jy is welkom
    Happy coding

+ 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. [SOLVED] Sort Worksheets by Date and then create summary worksheet with results
    By kingsdime29x in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-30-2017, 10:27 AM
  2. [SOLVED] Summary of dates and count
    By Smally in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-09-2015, 08:58 AM
  3. Show all dates as result in summary tab
    By Halmsteen in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-28-2014, 03:09 AM
  4. [SOLVED] Find and paste the summary value to the cell according to the dates
    By oozden in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-27-2014, 07:49 AM
  5. Sort (dates) copy and paste to other work shee (last row)
    By darkc0de1 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-14-2013, 10:59 AM
  6. Build Summary (top10) from Raw Data - Sort and Filter
    By exc4libur in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-09-2011, 10:27 PM
  7. Replies: 1
    Last Post: 06-22-2005, 10:05 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