View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Patrick Molloy Patrick Molloy is offline
external usenet poster
 
Posts: 1,049
Default Reinstate formulas in specific cells

on the sheet's code page (right click the tab and select View Code from the
popup menu)

Option Explicit
Private Sub Worksheet_Change(ByVal target As Range)
If target.Address = Range("R4").Address Then resetrow (target.Value)
End Sub
Sub resetrow(Rw As Long)
If Rw < 11 Or Rw Range("R11").End(xlDown).Row Then Exit Sub
Range("R3:V3").Copy
Cells(Rw, "R").PasteSpecial xlAll
Application.CutCopyMode = False
End Sub



"usmc-r70" wrote in message
...
Ive made great use of this form to solve my Excel problems, but this not
alludes me; Need your expertise!

I have cells that originally contained formulas, but the 'user' has the
option to input raw data into those cells. I need a way to reinstate
those
formulas into a range of cells on a row-by-row basis.

The original cells with formulas are contained in range: R11:V74

In cell R4 I have a cell where the €˜user can select the ROW where they
want
the formulas reinstated.

In cells R3:V3 I have the formulas ready to be copied and pasted into
appropriate cells on the selected ROW.

Additionally,
I need a solution that can be applied to other worksheets within the
workbook.

If the ROW selected is outside the first row (row 11), or outside the last
row (74) it does nothing and returns the cursor to the row selection box
in
cell R4. However, the user can add / delete rows so the solution needs to
determine where the last row of data is located. The starting row of data
will always be 11.