Here is what I use, modify to suit
Public Sub Everythingbylayer()
Dim objSelected As Object
Dim OBJSELSET As AcadSelectionSet
Dim N As Integer
On Error GoTo ERR_HAND
ThisDrawing.SetVariable "CECOLOR", "BYLAYER"
ThisDrawing.SetVariable "CELTYPE", "BYLAYER"
Set OBJSELSET = ThisDrawing.SelectionSets.Add("EBL")
OBJSELSET.Select acSelectionSetAll
For Each objSelected In OBJSELSET
objSelected.color = acByLayer
objSelected.Linetype = "ByLayer"
objSelected.Lineweight = acLnWtByLayer
objSelected.Update
Next
ThisDrawing.SelectionSets.Item("EBL").Delete
ZoomExtents
ThisDrawing.Application.Update
Exit_Here:
Exit Sub
ERR_HAND:
Select Case Err.Number
Case -2145320851
ThisDrawing.SelectionSets("EBL").Delete
Resume
Case -2145386413
Resume Next
Case Else
MsgBox Err.Number & " " & Err.Description
End Select
End Sub