G'day everyone,
Im using the following code to create a validation list. My question is this - how could I modify the string value to exclude a specified term.
I.e. If the cell.value found makes it thru to the line
ValUnique1.Add Cell.Value, CStr(Cell.Value)
and this value is "Fld Coordinator OH", then could i include an extra line before adding it to the collection so that if it contains "Fld Coordinator" then this term is removed, leaving only "OH" as the value to be added to the collection?
Dim Cell As Range
Dim ValUnique1 As New Collection
Dim rStr As String
Dim i As Long
On Error Resume Next
For Each Cell In Sheets(1).Range("A3:A3000")
If Not IsNumeric(Cell) Then
If Not Cell.Value Like "*Construction*" And Not Cell.Value Like "*BI*" Then
If Not Cell.Offset(1, 0).Value Like "*Construction*" And Not Cell.Offset(1, 0).Value Like "*BI*" Then
ValUnique1.Add Cell.Value, CStr(Cell.Value)
End If
End If
End If
Next Cell
Thanks heaps
Bookmarks