+ Reply to Thread
Results 1 to 4 of 4

Need a macro loop that finds highest date (if any) and returns in different cells

  1. #1
    Registered User
    Join Date
    02-11-2016
    Location
    Denmark
    MS-Off Ver
    Office 2010
    Posts
    5

    Need a macro loop that finds highest date (if any) and returns in different cells

    Hi!
    Im quite new into programming so i need some help with Building a macro.
    What i need it to do is:

    - Find the highest date in a row, lets say in row 3, column c-g (if all the cells are not empty)
    - Then return the date in row 3, column j
    - Then go the Next row (row 4) and the same columns as before and do the same.
    - And so on.
    - It is important that if the cells with the dates are empty, the macro should do nothing, cause there might already be a date in the cell where the macro should return the highest date.
    - The macro should continue for all rows in the sheet.

    Hope you can help me!

    Let me know if you want to se the macro i already have made, but i dont think it will do anything good for you.

    Thanks!

  2. #2
    Forum Expert sourabhg98's Avatar
    Join Date
    10-22-2014
    Location
    New Delhi, India
    MS-Off Ver
    Excel 2007, 2013
    Posts
    1,899

    Re: Need a macro loop that finds highest date (if any) and returns in different cells

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Happy to Help

    How to upload excel workbooks at this forum - http://www.excelforum.com/the-water-...his-forum.html

    "I don't get things easily, so please be precise and elaborate"

    If someone's post has helped you, thank by clicking on "Add Reputation" below the post.
    If your query is resolved please mark the thread as "Solved" from the "Thread Tools" above.

    Sourabh

  3. #3
    Registered User
    Join Date
    02-11-2016
    Location
    Denmark
    MS-Off Ver
    Office 2010
    Posts
    5

    Re: Need a macro loop that finds highest date (if any) and returns in different cells

    Thanks a lot! That just did the job!
    I just have one more thing that i forgot to mention:
    The macro will be running in af sheet where the number of rows is different from one day to another.
    - Is it possible to make the loop run until the last row that is not empty?

  4. #4
    Forum Expert sourabhg98's Avatar
    Join Date
    10-22-2014
    Location
    New Delhi, India
    MS-Off Ver
    Excel 2007, 2013
    Posts
    1,899

    Re: Need a macro loop that finds highest date (if any) and returns in different cells

    Okay then use this-
    Please Login or Register  to view this content.
    This macro will decide the last row by the row number of last used cell in Column A.
    So instead of Column A you can use other columns as per your requirement which decide the last row.

+ 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. function that returns true if it finds a string in a targeted cell
    By riwiseuse in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-13-2013, 10:20 AM
  2. [SOLVED] Macro that finds all cells which add up to zero
    By S1n1 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 07-30-2013, 04:14 PM
  3. [SOLVED] need formula that finds phone #, if true, returns empty cell
    By jessexcel in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 05-23-2013, 11:44 PM
  4. [SOLVED] userForm loop that returns info back into cells (with some cells not included)
    By Sleepyshy in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 12-13-2012, 12:04 PM
  5. Macro which finds and copy's cells based on values in other cells.
    By ScabbyDog in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-24-2012, 05:11 AM
  6. [SOLVED] Macro that returns a match resulting from highest contains search.
    By WBeach in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 08-01-2012, 01:41 PM
  7. macro to loop within a column until it finds a value
    By kshitij_dch in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-07-2012, 01:13 AM
  8. [SOLVED] Vlookup finds a blank, but returns a zero - HELP!
    By flummoxed in forum Excel General
    Replies: 6
    Last Post: 01-18-2005, 12:06 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