LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Converting Formulas to Hard Values and Vice Versa?

Dave: See my reply to Simon, just above. Thanks!

"Dave Peterson" wrote:

Lightly tested:

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim myRng As Range
Dim myCell As Range
Dim RngToInspect As Range

Set RngToInspect = Me.Range("F1").EntireColumn

Set myRng = Nothing
On Error Resume Next
Set myRng = Intersect(Target, RngToInspect)
On Error GoTo 0

If myRng Is Nothing Then
Exit Sub 'nothing changed in column F
End If

On Error GoTo ErrHandler:

Application.EnableEvents = False
For Each myCell In myRng.Cells
With myCell
Select Case LCase(.Value)
Case Is = LCase("Firm")
Me.Cells(.Row, "O").Value = Me.Cells(.Row, "O").Value
Me.Cells(.Row, "p").Value = Me.Cells(.Row, "p").Value
Me.Cells(.Row, "q").Value = Me.Cells(.Row, "q").Value
Case Is = LCase("Tentative")
Me.Cells(.Row, "O").Formula = "=Column_O_Calc"
Me.Cells(.Row, "p").Formula = "=Column_P_Calc"
Me.Cells(.Row, "q").Formula = "=Column_Q_Calc"
End Select
End With
Next myCell

ErrHandler:
Application.EnableEvents = True

End Sub


Harold Shea wrote:

I have a large spreadsheet which is updated with order statuses on a weekly
basis. Each row shows a different order. In Column E is the current status of
each order: "Firm" or "Tentative." In Columns O, P, and Q are formulas that
calculate various milestone dates for the order. These dates recalculate
throughout the life cycle of the order, but once the order status in Column F
turns to FIRM, these dates are frozen. Is there a way to use a
Worksheet_Change event to read the statuses in Column F and, when one changes
to FIRM, to replace the values in Columns O, P, and Q on that row with
whatever their current values are? And is the reverse possible in case a use
makes an error? You know, if a status changes back to TENTATIVE, for the
formulas in O, P, and Q to restore to formulas? (I've given the formulas
names "Column_O_Calc", "Column_P_Calc", and "Column_Q_Calc")

Users can do all of this manually, but the problem is that the sheet is a
couple of thousand lines long and the updates numerous. To complicate things,
the status info in Column F can be imported into the sheet from Oracle OR
manually changed by users, so any macro would have to respond to cell changes
in either case.

I'd really appreciate any help anyone can offer.


--

Dave Peterson

 
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
switching the axes, categories to values and vice versa darknight_814 Charts and Charting in Excel 0 February 10th 10 09:16 PM
If Hours 0, If Volume <= 0,(and vice-versa) then.... Steve Excel Worksheet Functions 4 November 21st 09 01:30 PM
Excel columns: Converting numbers to letters and vice versa Jack Excel Programming 15 March 29th 08 09:17 PM
Turn +ve to -ve & vice versa. Sinner Excel Programming 4 March 27th 08 01:54 PM
From pricelist to productslist and vice versa... Herman56 Excel Discussion (Misc queries) 0 March 29th 06 05:40 PM


All times are GMT +1. The time now is 06:04 PM.

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

About Us

"It's about Microsoft Excel"