You are here:

Excel/VBA code to find most recent revison in spreadhseet


Problem statement:

"Examine a "filename" containing numbers and letters in one cell, and find the most recent revision number in another directly adjacent cell. Hide all rows except row containing the most recent revision."

1) Here's an example of the data (below):
Column "A"   Column "B"
(Filename)   (revision)
1401UC          9 (this one most recent)
1401UC_Rev0005       5
1401UC_Rev0006       6
1401UC_Rev0007       7
1403UC          8 (this one most recent, etc.)   6
1403UC_Rev0007       7

2)Nice to have an inputbox for number of characters to be examined in filename ??? is this Necessary?
3)Nice to have an inputbox for column ID containing filename,
4)Nice to have an inputbox for column ID containing revision info.
5)revision information is numeric only,
6)Filename information is numeric and letters = variant?

Thank you so much for the help; this is beyond my skillset.

Hi Mike,

I have a feeling that we should be able to handle this need with a combination of formulae only and need not go into macros and things like that.
If you could send me an excel with a sample of your real data (non-confidential), I can try and work with it.
My email - . Please mention AllExperts in the subject line.

About Excel
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


All Answers

Answers by Expert:

Ask Experts




I can answer questions related to the following topics: 1. MS Excel - Creating and Linking Formulae, Running Pivot Tables, Vlookup etc. 2. Macros / VBA - Creating Macros to do specific jobs. Importing / Exporting / Validating Data in excel through Macros.


I've been working on excel for over 10 years and on VBA macros for over 3 years now.

Bachelor of Commerce, Chartered Accountant from The Institute of Chartered Accountants of India

©2016 All rights reserved.