View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default i need to record a macro to....

'-----------------------------------------------------------------
Private Sub Worksheet_Change(ByVal Target As Range)
'-----------------------------------------------------------------

On Error GoTo ws_exit:
Application.EnableEvents = False
If Target.Value = "F" hen
If Target.Address = "$F$4" Then
Worksheets("Sheet2").Activate
Worksheets("Sheet2").Range("E2").Select
ElseIf Target.Address = "$F$5" Then
Worksheets("Sheet2").Activate
Worksheets("Sheet2").Range("F2").Select
ElseIf Target.Address = "$F$6" Then
Worksheets("Sheet2").Activate
Worksheets("Sheet2").Range("G2").Select
End If
End If

ws_exit:
Application.EnableEvents = True
End Sub


--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"tinkerbellsmyhoe" wrote in message
oups.com...
Thank you all for replying so quickly and such good information. i
thought this would be a macro type code so that i could apply it to
only the certain buttons or cells that i would like. i need to add a
piece of code so that it only occurs if the cell matches a certain
text. in my case it is if the text in the cell is an "F".

Thanks again in advance,
Mike C.