Named table range repeating

The following code runs well, but the "Domestic 2 Day" creates the same range as the "Domestic 2 Day AM".
I can't logically figure out why....can anyone help??


Sub createrangenames()
    createtableranges "Domestic First Overnight", "FO", 1
    createtableranges "Domestic Priority Overnight", "PO", 1
    createtableranges "Domestic Standard Overnight", "SO", 1
    createtableranges "Domestic 2 Day AM", "E2AM", 1
    createtableranges "Domestic 2 Day", "E2", 1
    createtableranges "Domestic Express Saver", "ESP", 1
    createtableranges "Domestic 1Day Freight", "F1", 2
    createtableranges "Domestic 2Day Freight", "F2", 2
    createtableranges "Domestic 3Day Freight", "F3", 2
    createtableranges "Continental U.S. Ground", "GR", 3

End Sub

Sub createtableranges(title, codename, tbltype)
    Dim tr As Range
    Set tr = ActiveSheet.Cells.Find(title, ActiveSheet.Cells.SpecialCells(xlCellTypeLastCell))
If tr Is Nothing Then

    Exit Sub
End If
On Error Resume Next
   If tbltype = 1 Then
    ActiveSheet.Names.Add codename & "L_2", Me.Range(tr.Offset(3), tr.Offset(3).End(xlToRight))
    ActiveSheet.Names.Add codename & "P_2", ActiveSheet.Range(tr.Offset(4), tr.Offset(4).End(xlToRight).Offset(1))
    ActiveSheet.Names.Add codename & "_2", ActiveSheet.Range(tr.Offset(6), tr.Offset(6).End(xlToRight).End(xlDown))
    ActiveSheet.Names.Add codename & "HW_2", ActiveSheet.Range(tr.Offset(160), tr.Offset(160).End(xlToRight).End(xlDown))
   End If
   
    If tbltype = 2 Then
        ActiveSheet.Names.Add codename & "_2", ActiveSheet.Range(tr.Offset(7), tr.Offset(7).End(xlToRight).End(xlDown))
    End If


    If tbltype = 3 Then
    ActiveSheet.Names.Add codename & "_2", ActiveSheet.Range(tr.Offset(6), tr.Offset(6).End(xlToRight).End(xlDown))

    End If
    
On Error GoTo 0
End Sub

Open in new window

sample-data.xlsm
Euro5Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Saqib Husain, SyedEngineerCommented:
Change line 17 to

Set tr = ActiveSheet.Cells.Find(Title, ActiveSheet.Cells.SpecialCells(xlCellTypeLastCell), , xlWhole)

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Euro5Author Commented:
Perfect!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.