Thread: private sub
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default private sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If Not Intersect(Target, Range("H1,H2,J1,J2")) Is Nothing Then
Application.DisplayFormulaBar = False
Else
Application.DisplayFormulaBar = True
End If

End Sub


--

HTH

RP
(remove nothere from the email address if mailing direct)


"JT" wrote in message
...
I have the following private sub:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If ActiveCell = Range("H1") Or ActiveCell = Range("J1") Or ActiveCell

=
Range("H2") Or ActiveCell = Range("J2") Then
Application.DisplayFormulaBar = False
Else
Application.DisplayFormulaBar = True
End If

End Sub

The intent is for the formula bar to be displayed unless the activecell is
in H1, H2, J1, or J2.

Right now the formula bar is only displayed if there is data in a cell.

If
there is no data, the formalbar is hidden.

Any help would be appreciated......Thanks
--
JT