Avatar of Bright01
Bright01
Flag for United States of America asked on

Interval and Frequency Timing

I am looking for a solution that was noted in post 40952095 which has to do with the ability for a Frequency selection to always be less in time then the Interval it is contained in.

 

For example, if the Interval Metric were 'Day' then the only choices for Frequency Measure should be 'Second', 'Minute', 'Hour' and 'Day'.

Thank you,

B.
D--Data-Data-Temp-Interval-and-Freq.xlsm
Microsoft Excel

Avatar of undefined
Last Comment
[ fanpages ]

8/22/2022 - Mon
Martin Liss

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
' Don't allow the coice of a Frequency Measure to be a longer time period
' than the Interval Metric
Dim strEndCol As String
If Not Intersect(Target, Range("C11")) Is Nothing Then
    With Target.Validation
        .Delete
        Select Case Target.Offset(-1, 0)
            Case "Second"
                strEndCol = "C"
            Case "Minute"
                strEndCol = "D"
            Case "Hour"
                strEndCol = "E"
            Case "Day"
                strEndCol = "F"
            Case "Week"
                strEndCol = "G"
            Case "Month"
                strEndCol = "H"
            Case "Year"
                strEndCol = "I"
        End Select
         .Add Type:=xlValidateList, Formula1:="=C56:" & strEndCol & "56"
    End With
End If

Open in new window

ASKER CERTIFIED SOLUTION
Martin Liss

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
[ fanpages ]

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Bright01

ASKER
Thanks guys!  I ran through both solutions and they both work as far as I can tell.  Martin, you were in first and the refinement looks good.  Fanpages, thanks as always in also providing a solution.

You guys are great.

B.
Martin Liss

You're welcome and I'm glad I was able to help.

In my profile you'll find links to some articles I've written that may interest you.
Marty - MVP 2009 to 2015, Experts-Exchange Top Expert Visual Basic Classic 2012 to 2014
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
[ fanpages ]

No problem, B.