Hi,
I've created a dropdown list using "Data Validation" containing 5 items.
Each item in dropdown should run a macro when selected.
Should i use worksheet selection change event? or anything else
Thank you
Hi,
I've created a dropdown list using "Data Validation" containing 5 items.
Each item in dropdown should run a macro when selected.
Should i use worksheet selection change event? or anything else
Thank you
Use the worksheet Change event
Typically
![]()
If Not Intersect (Target, Range("yourdropdowncell")) Is Nothing Then Select Case Target Case = 1 'change to refelect what your actual drop down returns 'your macro for dropdown "1" value Case = 2 'your macro for dropdown "2" value '...etc... End Select End If
Richard Buttrey
RIP - d. 06/10/2022
If any of the responses have helped then please consider rating them by clicking the small star iconbelow the post.
Hi,
I've tried the following code and is doing nothing. Actually the dropdown has items-Three months, Six months, One year.
Can you please tell what changes should me made to get the code work.
![]()
Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Not Intersect(Target, Range("H14")) Is Nothing Then Select Case Target Case Is = 1 'One year 'Call calcfor12 Case Is = 2 'Six months 'Call calcfor6 Case Is = 3 'Three months 'Call calcfor3 End Select End If End Sub
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks