Link to home
Avatar of Bright01
Bright01Flag 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
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

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
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

Blurred text
THIS SOLUTION IS 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
SOLUTION
THIS SOLUTION IS 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.
Avatar of 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.
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
Avatar of [ fanpages ]
[ fanpages ]

No problem, B.