I'm going through someone else's code at a new job and I CAN NOT get this line of vba to run. It looks right, but I'm obviously missing something....maybe a setting within VBA or excel that is turned off.
Any help or suggestions would be greatly appreciated. Thank you in advance.
Line erroring out:
Line within surrounding code:
P.S. MRIBFwb is the workbook name (Set MRIBFwb = ThisWorkbook) at the top of this very lengthy code.
Any help or suggestions would be greatly appreciated. Thank you in advance.
Line erroring out:
VBA Code:
MRIBFwb.Names.Add Name:="TeamofThree", RefersTo:=.Range("A2", .Range("A2").End(x1Down))
Line within surrounding code:
VBA Code:
'Create Support tab to hold lists for drop-down validation
Sheets.Add(After:=Sheets(Sheets.Count)).Name = "Support"
Set Supportws = Sheets("Support")
With Supportws
.Range("A1").Value = "Team of 3"
.Range("B1").Value = "Leasing Manager"
.Range("C1").Value = "Market"
.Range("D1").Value = "SPP/Non-SPP"
.Range("D2").Value = "SPP & Non"
.Range("D3").Value = "SPP"
.Range("D4").Value = "Non-SPP"
.Range("E1").Value = "Share"
.Range("E2").Value = "Consol"
.Range("E3").Value = "At-Share"
Occ_Summws.Range("C6", "E" & Occ_SummLR).Copy .Range("A2")
.Range("A1", .Range("A1").End(xlDown)).RemoveDuplicates Columns:=Array(1), Header:=xlYes
.Range("B1", .Range("B1").End(xlDown)).RemoveDuplicates Columns:=Array(1), Header:=xlYes
.Range("C1", .Range("C1").End(xlDown)).RemoveDuplicates Columns:=Array(1), Header:=xlYes
.Range("A1", .Range("A1").End(xlDown)).Sort Key1:=.Range("A1"), Order1:=xlAscending, Header:=xlYes
.Range("B1", .Range("B1").End(xlDown)).Sort Key1:=.Range("B1"), Order1:=xlAscending, Header:=xlYes
.Range("C1", .Range("C1").End(xlDown)).Sort Key1:=.Range("C1"), Order1:=xlAscending, Header:=xlYes
.Range("A2").Insert xlShiftDown
.Range("A2").Value = "All Teams"
.Range("B2").Insert xlShiftDown
.Range("B2").Value = "All Lease Mgrs"
.Range("C2").Insert xlShiftDown
.Range("C2").Value = "All Mkts"
.Range("A1:E1").Font.Bold = True
MRIBFwb.Names.Add Name:="TeamofThree", RefersTo:=.Range("A2", .Range("A2").End(x1Down))
MRIBFwb.Names.Add Name:="LeaseMgr", RefersTo:=.Range("B2", .Range("B2").End(x1Down))
MRIBFwb.Names.Add Name:="Market", RefersTo:=.Range("C2", .Range("C2").End(x1Down))
MRIBFwb.Names.Add Name:="SameStore", RefersTo:=.Range("D2", .Range("D2").End(x1Down))
MRIBFwb.Names.Add Name:="Share", RefersTo:=.Range("E2", .Range("E2").End(x1Down))
End With
P.S. MRIBFwb is the workbook name (Set MRIBFwb = ThisWorkbook) at the top of this very lengthy code.