ETA:
I have some code but it contains errors.
Code: Select all
Private Sub Workbook_Open()
Worksheets("ShowAllWorkbooks").Activate
Sub FillCompanyNames()
Worksheet("Sheet1").Select
Dim x As Integer
' Set numrows = number of rows of data.
NumRows = Range("A2", Range("A2").End(xlDown)).Rows.Count
' Select cell a1.
Range("A2").Select
' Establish "For" loop to loop "numrows" number of times.
For x = 2 To NumRows
If Cells(x, 2) = "" Then
If UCase(Cells(x, 1)) = "ETW" Then
Cells(x, 2) = "Eaton Vance Tax-Managed Global Buy-Write Opportunities Fund"
ElseIf UCase(Cells(x, 1)) = "ETY" Then
Cells(x, 2) = "Eaton Vance Tax-Managed Diversified Equity Income Fund"
ElseIf UCase(Cells(x, 1)) = "GUT" Then
Cells(x, 2) = "Gabelli Utility Trust"
ElseIf UCase(Cells(x, 1)) = "PCF" Then
Cells(x, 2) = "High Income Securities Fund"
ElseIf UCase(Cells(x, 1)) = "USOI" Then
Cells(x, 2) = "Credit Suisse X-Links Crude Oil Shares Covered Call ETNs"
ElseIf UCase(Cells(x, 1)) = "VGI" Then
Cells(x, 2) = "Virtus Global Multi-Sector Income Fund"
End If
End If
' Selects cell down 1 row from active cell.
ActiveCell.Offset(1, 0).Select
Next
End Sub
End Sub