How to find column with oldest date?

rizzo93

Active Member
Joined
Jan 22, 2015
Messages
299
Office Version
  1. 365
I have a row containing formulas that will either show a date or a "".

ABCDEF
6/56/46/36/2

Using VBA, I want to find the column where the oldest date is located in that row. So in the example above, I need to identify the column where 6/2 is located.

How can I do this please?
 
That's fine, it means that it's a real date & not text.
Maybe
VBA Code:
   Set fnd = Range("A1:F1").Find(Format(Mn, "m/d"), , xlValues, xlWhole, , , , , False)
 
Upvote 0

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
It worked! Thanks so much! (y)

A question about a previous reply you made yesterday. You posted:
VBA Code:
Application.min(range("A1:F1"))

Ordinarily, I use Application.WorksheetFunction.(and whatever function I need at the time)

So is WorksheetFunction redundant now?
 
Upvote 0
You can use it or not, it's up to you.
If you use it then you get the intellisense, which you won't get without it, but on the other hand some functions like Vlooup & match will "crash" if a match is not found & you have used Worksheetfunction.
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,200
Messages
6,123,612
Members
449,109
Latest member
Sebas8956

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top