View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson[_3_] Jim Thomlinson[_3_] is offline
external usenet poster
 
Posts: 983
Default Re-defining Ranges in VBA

Once all of your cutting and pasting is done you can use code something like
this...

ThisWorkbook.Names.Add "RawData",
Range(activesheet.Range("A65535").End(xlUp), activesheet.Range("C1"))

This code creates a named range (RawData) from from the last row of data in
column A to the first row in column C...

HTH

"aehan" wrote:

Can anyone help please? I have a macro which imports data, replacing data
which is already there and has been range named. When the import has
finished, the range name re-defines itself and cuts out some of the columns
and rows that were originally there.

Is there a way in VBA that I can get therange name to automatically
re-define itself based on the new current region so that it sees all of the
new data?

I'm new at this and I'm struggling, so any help would be really appreciated

Thanks