function LINEST

G

God Itself

Hi

i have function:

Function RegLinMod(rng1 As Range, rng2 As Range, a As Long, b As Long, c As Long, d As Long)

Application.Volatile

Set rng1 = rng1.Parent.Range(rng1.Rows(1 + a), rng1.Rows(rng1.Rows.Count - b))
Set rng2 = rng2.Parent.Range(rng2(Rows(1 + a), Columns(1 + c)), rng2(Rows(rng2.Rows.Count - b), Columns(rng2.Columns.Count - d)))
RegLinMod = Application.WorksheetFunction.LinEst(rng1, rng2, 0, 1)

End Function

why columns property cause circular reference?
 
M

measekite Da Monkey

If you are GOD then you already know the answer.



Hi

i have function:

Function RegLinMod(rng1 As Range, rng2 As Range, a As Long, b As Long, c As
Long, d As Long)

Application.Volatile

Set rng1 = rng1.Parent.Range(rng1.Rows(1 + a), rng1.Rows(rng1.Rows.Count -
b))
Set rng2 = rng2.Parent.Range(rng2(Rows(1 + a), Columns(1 + c)),
rng2(Rows(rng2.Rows.Count - b), Columns(rng2.Columns.Count - d)))
RegLinMod = Application.WorksheetFunction.LinEst(rng1, rng2, 0, 1)

End Function

why columns property cause circular reference?
 
G

God Itself

hi

even god may have problems with vba ;)

but being serious.

function without Columns works ok (but then i may only add/remove rows from original range)
problem is when i want to add/remove columns fromoriginal range...

regards
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top