View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
c1802362[_3_] c1802362[_3_] is offline
external usenet poster
 
Posts: 7
Default renaming excel data lists

Thanks!

On Nov 6, 3:03*pm, Gord Dibben <gorddibbATshawDOTca wrote:
With a list of your desired names in H1:H10

Sub Rename_Lists()
Dim lst As ListObject
* Dim rng As Range
* Dim i As Integer
* On Error GoTo endit
* * * Set rng = Range("H1")
* * * For Each lst In ActiveSheet.ListObjects
* * * lst.Name = rng.Offset(i, 0).Value
* * * i = i + 1
* * * Next lst
* * * Exit Sub
endit:
* MsgBox "there is a List by that name, re-type a name"
End Sub

To rename just a single List.

Sub rename_one_list()
ActiveSheet.ListObjects("List1").Name = "AddressList"
End Sub

Gord Dibben *MS Excel MVP