Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Parastoo Parto
 
Posts: n/a
Default how can I select two different values for a cell?

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?
  #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?



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to pass values of a cell? Me Excel Discussion (Misc queries) 4 March 4th 05 05:35 PM
Why will solver only return the original adjustable cell values? Del Excel Worksheet Functions 0 March 3rd 05 12:25 AM
Mouse continues to select after clicking on a cell in excel. Fletch Excel Discussion (Misc queries) 4 February 22nd 05 02:27 AM
Cell Values Formula BubbaJ Excel Worksheet Functions 1 January 30th 05 11:40 PM
GET.CELL Biff Excel Worksheet Functions 2 November 24th 04 07:16 PM


All times are GMT +1. The time now is 05:29 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"