Excel/VBA To Return Most Recent date For A value
Thank you for assisting me in the past.
I use Excel 2007. Currently working on a large spreadsheet with several thousand rows and records of LPG tank records.
Attaching a simplified image with random data and dates(not actual).
Sample data Arrangement:
Column "A" - Serial Numbers, Column "B"- Inspection Date, Column "C"- External Inspection date, and Column - "D" - Internal Inspection Date.
Each Serial number can have several inspection dates with external and internal dates next to it in the adjacent columns.
I need a vba that will for each unique value in column "A" return the max inspection date from Column "B" for that unique value, and the corresponding "Next External" from Column "C" and "Internal" Inspection Dates from Column "D".
why not just add a column to the first sheet (with the data). Assuming the data starts in A2 with a header in A1 (Assumes Excel 2007 or later)
Drag fill down the column E
Now filter on column E selecting "Yes"
copy to the master sheet.
That should give you what you want.
If you need code to do that, then just turn on the macro recorder while you do it manually.
This topic answers questions related to Microsoft Excel spreadsheet (or workbook) stand-alone or Mircrosoft Office Excel including Excel 2003, Excel 2007, Office 2000, and Office XP. You can get Excel help on Excel formulas(or functions), Excell macros, charting in Excel, advanced features, and the general use of Excel. This does not provide a general Excel tutorial nor the basics of using a spreadsheet. It provides specific answers to using Microsoft Excel only. If you do not see your Excel question answered in this area then please ask an Excel question here