Dynamic macro parameters

D

Derek

When calling an add-in function from a worksheet, is
there a way to make the parameter change when a row is
inserted or deleted? In other words, I have a function
that receives an argument that is a row number. If the
row number changes, I want my argument to automatically
change. The built-in functions do this, but I have not
been able to figure out how to make my functions do
this. If I use Row(A37) as the argument, it works great,
however, I only want to pass the row number not use a
built-in function as a filter.
 
F

Frank Kabel

Hi
the function parameter will only change if you use a reference as
parameter. e.g.
your_function(A1)
or
your_function(ROW(1:1))

no chance with
your_function(1)
as Excel does not know that your '1' represents a row number
 
B

Bob Phillips

Also there is no need to pass the row number. Pass the cell or row as a
range and extract the row number in the add-in

... = rng.Row

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Top