I couldn't think of any simple way to get your column B values, but I tweaked a macro I had to do it for you.
Option Explicit
Sub GetVenues()
'Jerry Beaucaire 5/13/2010
'Extract venue names from long strings using a list of venues
Dim LastRw As Long
Dim CNT As Long
Dim Venues As Range
Dim Venue As Range
Application.ScreenUpdating = False
Set Venues = Sheets("Sheet2").Range("A:A").SpecialCells(xlCellTypeConstants)
With Sheets("Raw Data")
.Rows(1).Insert xlShiftDown
.Range("A1") = "key"
CNT = 1
For Each Venue In Venues
Application.StatusBar = CNT & " of " & Venues.Cells.Count
.Range("A:A").AutoFilter Field:=1, Criteria1:="*" & Venue & "*"
LastRw = .Range("A" & .Rows.Count).End(xlUp).Row
If LastRw > 1 Then _
.Range("B2:B" & LastRw).Value = Venue
CNT = CNT + 1
Next Venue
.AutoFilterMode = False
.Rows(1).Delete xlShiftUp
.Range("A:B").Columns.AutoFit
End With
Set Venues = Nothing
Application.ScreenUpdating = True
Application.StatusBar = False
End Sub
How/Where to install the macro:
1. Open up your workbook
2. Get into VB Editor (Press Alt+F11)
3. Insert a new module (Insert > Module)
4. Copy and Paste in your code (given above)
5. Get out of VBA (Press Alt+Q)
6. Save as a macro-enabled workbook
The macro is installed and ready to use. Press Alt-F8 and select GetVenues from the macro list.
Bookmarks