View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bernie Deitrick Bernie Deitrick is offline
external usenet poster
 
Posts: 5,441
Default Change event macro

Naz,

Copy the code below, right click the sheet tab of your worksheet, select
"View Code", and paste the code into the window that appears. Assumes that
your 12 formulas start in cell D1: change the address in the code if they
actaully start in a different row.

HTH,
Bernie
MS Excel MVP

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Then Exit Sub
If Target.Column 3 Then Exit Sub
Application.EnableEvents = False
Range("D1").Resize(1, 12).Copy Cells(Target.Row, 4)
Cells(Target.Row, 4).Resize(1, 12).Value = _
Cells(Target.Row, 4).Resize(1, 12).Value
Application.EnableEvents = True
End Sub



"Jimbola" wrote in message
...
Hi all,

I have a worksheet that has a about 58,000 rows and 15 coloums. (A-O)
Columns A and C contain data that is used in the remaining columns.
Unfortunately having live formulas in all the columns results in a really
slow spreadsheet.
What I would like is to have the formula reside in only the first row
colum
D-O
And then if on a particular row a change is made to column A or C the
macro
would copy that formula from the first row and past it into the relevant
row
and turn the result into a value. That way Excel only calculates for that
row.
I have a very vague idea of how to use the change_event .

E.g (where f1-f12 are formulas)

a b c d e f g h i j k l
m n o
1 20 C 10 f1 f2 f3 f4 f5 f6 f7 f8 f9 f10
f11 f12
2 10 D 40
3 30 S 10 e.g A change to colum A or C results in f1 to f12
being copied
here and turned to values

All help is greatly appreciated

Naz