View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 10,593
Default Programatically increase the size of all named ranges

Sub IncreaseRanges()
Dim nme As Name
Dim rng As Range

For Each nme In ActiveWorkbook.Names
On Error Resume Next
Set rng = Range(nme.RefersTo)
On Error GoTo 0
If Not rng Is Nothing Then
Set rng = rng.Resize(150 - rng.Row + 1)
ActiveWorkbook.Names.Add Name:=nme.Name, RefersTo:=rng.Address(,
, , True)
Set rng = Nothing
End If
Next nme
End Sub

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

wrote in message
ups.com...
Hi,

I have about 25+ named ranges in my excel workbook. All of these ranges
currently end at row 250 and I want to increase this to 1500 for all
ranges. How do I do this programatically?

Any help is deeply appreciated.

Thanks,
Ashwin