View Single Post
  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default

One way you could do it is to use worksheet selection event code that create
one formula when selected, another when not selected. Something like

Private prevCell As Range

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If Target.Address = "$H$10" Then
Target.Formula = "=SUM(A1:A10)"
ElseIf Not prevCell Is Nothing Then
If prevCell.Address = "$H$10" Then
prevCell.Formula = "=IF(A110,1,2)"
End If
End If
Set prevCell = Target

End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.

You will need to change the formulae to suit, and be aware that yo canm
never see one of them in the formula bar, because as soon as you select it,
it changes.

--

HTH

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


"Parastoo Parto" <Parastoo wrote in message
...
I have a sheet with one column I would like to give it two values. In fact

I
would like the column show me the ACTUAL value or the FORECAST value

anytime
I want .I don't like to make 2 columns and fill one column with actual

data
and the other with forecast data.How can I do that?