View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Dale[_17_] Dale[_17_] is offline
external usenet poster
 
Posts: 4
Default Auto size named range by .Net or VBA

I have a question about adding data to a named range.

I have an application that takes data from an Oracle database and writes it
to a specified Excel file starting at a column and row specified in the
command line. I would like to change that so it writes to a named range.

Because there are several macros in the Excel template I am writing to,
those macros need to select ranges sized precicely for the data existing in
the sheet and not, as they currently do, by selecting huge numbers of columns
and cells just to cover all possibilities.

So, my question is, if I have a named range as a single cell as a starting
point, how would I add data to that row, then the next row, etc., etc., in a
way that would cause the named range to automatically expand as I added
(inserted?) the data? Also, for a couple reports, I need other named ranges
below the target range to automatically move down in the report as I insert
new rows to the target named range - those other named ranges will become the
target for other sets of data.

Thanks in advance for any help or suggestions.

Dale
--
Dale Preston
MCAD C#
MCSE, MCDBA