View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Hong Quach Hong Quach is offline
external usenet poster
 
Posts: 21
Default worksheet-change event in combination with a select case statement

Hi Abdul,

Do you know how to use each separately? I mean, do you know how to setup a
worksheet-change event that trigger by change in a particular cell?

Private Sub Worksheet_change(ByVal Target As Range)
Dim ws As WorkSheet
Set ws = ActiveSheet
If (Target.Row = 5 And Target.Column = 5) Then
' Code to do thing here if the Cell "E5" changes
' This is where you would put the Select Case statement to decide what to
format or whatever you want Excel to do.
End If
End Sub

Part 2 of the question is the Select Case statement. You don't have to use
Select-case statement if you not familiar with it, just use nested If Else
statements.

Hong Quach

"Abdul" wrote:

I've heard that combining "Worksheet-change event", along with "Select Case
Statement" can be used to change format of cells the same way as "Conditional
Formatting" is used, but I don't know how does one use those 2. I appreciate
examples.