how to fill the multiple cell using UDF.

P

parmanand

Hi,
I have followes the following example to create the automation add-ins.
http://blogs.msdn.com/eric_carter/archive/2004/12/01/273127.aspx
This example work perfectly.
In the function given at the end of these document i have made a little bit
change.

public double NumberOfCells(object Range)
{
Excel.Range r = Range as Excel.Range;
foreach( Itshouldbecell c in Range)// want to know what type to use for in
place of Itshouldbecell
{
//want to know code for assigning value to the cell in the range
}

return r.Cells.Count;
}

eg. i write in the excel as : = NumberOfCells(b2:c3)
so i want to assign b2=2
b3=3
c2=4
c5=5.

Please help to find out the solution.
thanks.
 

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