Longtime member.....been years since I posted

ken2step

Well-known Member
Joined
Jan 9, 2003
Messages
642
Cells A1:J1 contain dates formatted to display the year only.

Cell A2 I would like to enter a year.

Then I need a validation formula that would evaluate if that year is present in cells A1:J1

Would someone please help with this?

thanks,
Ken
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
 
Upvote 0
try this
VBA Code:
Dim current As String
Dim check As String

current = Format(DateTime.now, "YYYY")'''change
check = Range("B1").Text

If check = current Then
 
Upvote 0
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
I sure will...thanks! But status is same......Windows 10 - Excel 2010
 
Upvote 0
try this
VBA Code:
Dim current As String
Dim check As String

current = Format(DateTime.now, "YYYY")'''change
check = Range("B1").Text

If check = current Then
Sorry don't know how to use VBA. Looking for a formula to use in Validation.
 
Upvote 0
How about
Excel Formula:
=IF(ISNA(MATCH(A2,YEAR(A1:J1),0)),"No", "Yes")
 
Upvote 0
In that case you do not have real dates in A1:J1, what is in those cells?
 
Upvote 0
Try Confirming the formula with Ctrl Shift Enter.
 
Upvote 0

Forum statistics

Threads
1,215,025
Messages
6,122,734
Members
449,094
Latest member
dsharae57

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