View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Howard Howard is offline
external usenet poster
 
Posts: 536
Default select case syntax to other sheets

Excel 2010

Sheet 1 B1 has a drop down with Don, Kim, Bob & " ".

What is the proper syntax to get Case Is = "Kim" & Case Is = "Bob" to work properly. Case Is = "Don" works but probably because it is on sheet1.

Thanks.
Regards,
Howard

Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)
On Error Resume Next
Dim TheDon As Range, TheKim As Range, TheBob As Range
Set TheDon = Sheets("sheet1").Range("C1:D10")
Set TheKim = Sheets("sheet2").Range("E1:F10")
Set TheBob = Sheets("sheet3").Range("G1:H10")

Select Case ActiveCell.Value

Case Is = "Don"
TheDon.Select
MsgBox "Don's stuff"

Case Is = "Kim"
TheKim.Select
MsgBox "Kim's stuff"

Case Is = "Bob"
TheBob.Select
MsgBox "Bob's stuff"

Case Is = " "
MsgBox "Blank (space) stuff"
End Select
End Sub