Changing Name Range based on imported data

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Data is being imported and fills a variable number of rows. I start by
determining the range of cells and then assign a name with the following
macro:

Range("A8").Select
Selection.CurrentRegion.Select
ActiveWorkbook.Names.Add Name:="Input_Range", RefersToR1C1:= _
"=Sheet2r!R8C1:R92C8"

The problem is I want to use this as a template and the range is set at
"=Sheet2r!R8C1:R92C8" and I want it to be the area selected by the
CurrentRegion function.
 
Selection.CurrentRegion.Select
selection.Name="Input_Range"

will do what you want and is much easier thatn using Names.Add
 
Works perfect.
--
Thanks,
TeeSea


Tom Ogilvy said:
Selection.CurrentRegion.Select
selection.Name="Input_Range"

will do what you want and is much easier thatn using Names.Add
 

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

Back
Top