Okay let's try this, select the worksheet that contains that cell E1 that changes. Right click on the worksheet tab and select the View Code option. In the space provided copy and paste the below code. Anything that appears in green is a comment meant to help you understand.
Private Sub Worksheet_Change(ByVal Target As Range) 'on the worksheet change
'if the cell that was changes is M6 or Z6 then
If Target.Address = "$M$6" Or Target.Address = "$Z$6" Then
Select Case Range("H1").Value 'if the value in cell H1 is equal to...
Case "LEG1" 'LEG1 then...
legtwoodd 'run legtwood macro
Case "LEG2" 'LEG2 then...
legthreeodd 'legthreeodd macro
Case "LEG3" 'LEG3 then...
legfourodd 'run legfourodd macro
Case "LEG4" 'LEG4 then..
legfiveodd 'run legfiveoddmacro
End Select 'end select statements
End If 'end if that cell's changed
End Sub
Close out of Visual Basic and then change the value in either M6 or Z6 to watch it work.
Bookmarks