Maybe:
![]()
Sub EnterFormula() Worksheets("Sheet1").Range("M65").Formula = "=AVERAGE(M6:M47)" Range("M67") = Range("M66").Value 'On Deck becomes Prior Data Range("M66") = Range("M65").Value 'New data copied to On Deck area End Sub
Dom
Maybe:
![]()
Sub EnterFormula() Worksheets("Sheet1").Range("M65").Formula = "=AVERAGE(M6:M47)" Range("M67") = Range("M66").Value 'On Deck becomes Prior Data Range("M66") = Range("M65").Value 'New data copied to On Deck area End Sub
Dom
"May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."
Use code tags when posting your VBA code: [code] Your code here [/code]
Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.
1. There no need to insert the formula repetitively.
2. There no call to EnterFormula in the code that appears. If it's called from VBA, it should be in a code module, not the sheet module. If it's called as a worksheet function, it won't work regardless of where it appears.
Entia non sunt multiplicanda sine necessitate
Unfortunately not![]()
So it is getting more clear because my cells ranged from M6 to M47 contain formulas, too.
In tis case I have to write them too with macro. So is this a true definition?
So at the and it should look like that but I could make it Run:![]()
Sub EnterFormula() Worksheets("Sheet1").Range("M6:M47").Formula = "=([(K6:K47)-(L6:L47)]/L6:L47)" End Sub
B6:B47 called from external source.
Kur.xlsm![]()
Private Sub Worksheet_Change(ByVal Target As Range) If Not Intersect(Target, Range("B6:B47")) Is Nothing Then Application.EnableEvents = False Range("K6:K47").Copy Range("L6:L47") 'On Deck becomes Prior Data Range("B6:B47").Copy Range("K6:K47") 'New data copied to On Deck area Application.EnableEvents = True End If End Sub Sub EnterFormula() Worksheets("Sheet1").Range("M6:M47").Formula = "=([(K6:K47)-(L6:L47)]/L6:L47)" End Sub Sub EnterFormula() Worksheets("Sheet1").Range("M65").Formula = "=AVERAGE(M6:M47)" Range("M67").Copy Range("M66").Value 'On Deck becomes Prior Data Range("M66").Copy Range("M65").Value 'New data copied to On Deck area End Sub
Last edited by Litstone; 03-18-2010 at 12:18 PM. Reason: Attached .xlsx
I am very new with macros and I have spent a full of my day for this thing. I am feeling like a dummy blond crash test mannequin.
I am feeling like a dummy blond crash test mannequin
The thread is marked Solved -- is it?
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks