Excel Named Ranges In VB.net

W

Wayne N

I have a need to determine the start row and column of an excel named range
using vb.net.

I have successfully loaded a named range into a datagridform and now I need
to save it to the same named range I extraced it from.
 
J

John Bundy

I build the subroutines/functions on the excel side and just pass in the
data, that way i (or others) can easily manipulate the named ranges without
..NET coding experience. Just call the function or routine

xlApp.Run("SLEOutReport")

you can pass data like
xlApp.Run("SLEOutReport",data)
 
W

Wayne N

Sorry, I think I asked the question wrong. I am using a datgridview control
and load that with a named range in an excel worksheet. When I try to write
it back to the worksheet I do not know how to start the data transfer using
the first cell in the named range. When I just save the datagridview data
it starts in Cell A1. I can hard code the for loop to offset the destination
data to match the particular worksheet ok but I need to use this code
generically so need to be able to retrieve the start cell of a named range
and use that as offset in the for loop I have for writing the datagrid view
data to the sheet.

Thanks for your help
 
D

Doug Glancy

Wayne,

How about:
range("myRange").Cells(1)
or
range("myRange").Cells(1).address?

hth,

Doug
 

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