i have never had an issue with this until now. Please take a look at the code below, it is on a Module in the workbook (not code on the worksheet), the code breaks when it tries to set a range.
Private Sub UpdateTickerList()
Dim MyWS As Worksheet
Dim a, b, c As Integer
Dim NewStockRng As Range
Dim RealTickFeed As Range
'On Error Resume Next (i took this out to get the error)
'initializes variables
a = 0
b = 0
'defines the worksheet we are going to work on
Set MyWS = Workbooks("Portfolio.xlsm").Worksheets("Feed")
'finds last row
b = MyWS.Range("a10000").End(xlUp).Row + 1
'finds how large is the new stock universe
a = 8 'UBound(NPSeCompran)
'defines a new range in which to copy the new symbols
Set NewStockRng = MyWS.Range(Cells(b, 1), Cells(b + a - 1, 1)) 'i need to
'use b+a-1 to reflect the fact that if i
'have row97 as my first row and 11 elements then i need to count row 97
'as#1, otherwise i end up with one more row
'copies the stocks to the range
NewStockRng.value = Application.Transpose(NPSeCompran)
'now sort the list
Set RealTickFeed = MyWS.Range("a3").CurrentRegion
RealTickFeed.Sort key1:=MyWS.Range("a3"), Header:=xlYes
'now get rid of duplicates
RealTickFeed.RemoveDuplicates Columns:=Array(1, 9), Header:=xlYes
ErrorHandler:
End Sub