Kamis, 16 Oktober 2014

[ExcelVBA] Validation list change events

 


Good afternoon all,

I have created a valiation list and added the following code to it but I can't get it to fire/update until I manually move off of the list/cell then back on to it.

Option Explicit
Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If Target.Address = Me.Range("FormSel").Address Then
    If Target.Value = "Blended" Then
        Sheets("Blended").Visible = True
        Else
        Sheets("Blended").Visible = False
    End If
    If Target.Value = "Flat Rate" Then
        Sheets("Flat Rate").Visible = True
        Else
        Sheets("Flat Rate").Visible = False
    End If
    If Target.Value = "Preferred" Then
        Sheets("Preferred").Visible = True
        Else
        Sheets("Preferred").Visible = False
    End If
    If Target.Value = "Standard" Then
        Sheets("Standard").Visible = True
        Else
        Sheets("Standard").Visible = False
    End If

End If
   
End Sub
What am I missing?

 

Thank you,

 

Mark  

__._,_.___

Posted by: m_bacheldor@yahoo.com
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (1)
----------------------------------
Be sure to check out TechTrax Ezine for many, free Excel VBA articles! Go here: http://www.mousetrax.com/techtrax to enter the ezine, then search the ARCHIVES for EXCEL VBA.

----------------------------------
Visit our ExcelVBA group home page for more info and support files:
http://groups.yahoo.com/group/ExcelVBA

----------------------------------
More free tutorials and resources available at:
http://www.mousetrax.com

----------------------------------

.

__,_._,___

Tidak ada komentar:

Posting Komentar