• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 869
  • Last Modified:

Vb to redefine range names

I have a range named 'TEST' in a workbook which comes from another worksheet ('MASTER') in the same workbook.  The file gets replaced on a weekly basis and I would like to automate redefining the range through vb.  If the range for 'TEST' is currently set to ='Master'!$B$2:$F$69.  I need to find the last cell in the new test and extend the range.  I hope this makes sense.
0
ilrosebud26
Asked:
ilrosebud26
  • 2
  • 2
1 Solution
 
Jeroen RosinkCommented:
You might try a macro like this one:

Sub ResetDefinedName()
RowsA = Sheets("Master").Cells(Rows.Count, 1).End(xlUp).Row
ActiveWorkbook.Names.Add Name:="TEST", RefersToR1C1:="Master!R6C2: R" & RowsA & "C6" & Chr(32)
End Sub

regards,
Jeroen
0
 
ilrosebud26Author Commented:
Jeroen-
    Thanks for the quick response.  I will try that out.

Rosemary
0
 
Jeroen RosinkCommented:
If you need further assitance let me know.
Jeroen
0
 
ilrosebud26Author Commented:
With a slight modification I was able to use this...it is great to get a correct response so quickly!
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now