Expand named range dynamically

B

bullpit

Hi all,
I have an excel template to which I insert records using C# and JET OLEDB. I
need to skip a few rows (10 precisely) and for that purpose I am defining a
named range in excel sheet which starts from the 10th row and includes all
the fields in the header I may require while doing an SQL insert and for that
reason, I want the range to grow dynamically to include more records as they
are added. I can do it if I use an unnamed range (just by keeping a track of
the current range and incrementing it by 1 in C# code) but I want to do it
for a named range.
I have tried OFFSET() thingy but can't seem to make it work.
This is what I tried:
1) Define a named range which only includes the header (myRange).
2) Use either
=OFFSET(Product_Pricing!$C$10,0,0,COUNTA(Product_Pricing!$C:$C),1)
OR
=OFFSET(Product_Pricing$C$10,0,0,COUNTA($C$2:$C$200),3)

Product_Pricing is the name of the sheet.
C10 is the cell from where I want to start the range.
Width of the range can be any number of columns defined by me.

Please let me know what I am doing wrong???

Thanks so much...
bullpit
 

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