Private Sub Worksheet_Change(ByVal Target As Range)
'
If Not Intersect(Target, Range("C1")) Is Nothing And Target.Cells.Count = 1 Then
Select Case Target
Case Is = "y1"
MsgBox "you've selected y1"
Case Is = "y2"
MsgBox "you've selected y2"
Case Is = "y3"
MsgBox "you've selected y3"
End Select
End If
End Sub
If Not Intersect(Target, Range("C1")) Is Nothing And Target.Cells.Count = 1 Then
Private Sub Worksheet_Change(ByVal Target As Range)
'Modified 11/23/2021 3:40:42 PM EST
If Target.Cells.CountLarge > 1 Or IsEmpty(Target) Then Exit Sub
If Target.Column = 3 Then
MsgBox "you've selected " & Target.Value
End If
End Sub
Hi Johnny,Right click the sheet tab that has your drop down list and select 'view code'.
Paste the following code into the big window that pops up:
VBA Code:Private Sub Worksheet_Change(ByVal Target As Range) ' If Not Intersect(Target, Range("C1")) Is Nothing And Target.Cells.Count = 1 Then Select Case Target Case Is = "y1" MsgBox "you've selected y1" Case Is = "y2" MsgBox "you've selected y2" Case Is = "y3" MsgBox "you've selected y3" End Select End If End Sub
Change the 'C1' in the following line to the cell address that has your drop down list:
VBA Code:If Not Intersect(Target, Range("C1")) Is Nothing And Target.Cells.Count = 1 Then
Then go back to your sheet with the drop down list and try it out.
1)Converter tab - different tab in the same sheetPlease explain in words what exactly you want to happen if 'y1' is selected from the drop down list.
Is 'CONVERTER TAB' a different sheet name? What is 'Import'? What is 'Same year'? What is the name of the sheet tab with the drop down list?
if i select any year from drop down list--- it should show the message and delete a value the cell which is in the converter tab1)Converter tab - different tab in the same sheet
2)Import is a cell in the converter tab
3)same year you can ignore
4)Name of the tab with drop-down list calculations
which is in cell I2 in converter tabif i select any year from drop down list--- it should show the message and delete a value the cell which is in the converter tab