Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Return Cell Contents on Partial Match

Status
Not open for further replies.

bradenpintar

IS-IT--Management
May 10, 2010
1
CA
I have a list of user email aliases that I need to process. The data is arranged with one user per row and the aliases are one to a column. The addresses per user are from many domains.

I am trying to extract the address for a given domain for each user to a working column for further processing. So, I am trying to figure out the combination of formulas needed to look across the row and identify the domain in the email address. If it matches, then display the entire address.

The addresses are not any particular order in each row.

I have written some code that does it, but I would like to know if this can be done with formulas.

In the example file I would like to extract radio.company.ca to the A column.

Thanks.
 



Hi,

radio.company.ca?????

How do you get THAT, given your example?

Please explain clearly, concisely and completely.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 


also, VBA ought to be posted, and will be best addressed in forum707.

So, please repost your question, and example in forum707, along with your answer to my previous post.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 


Try this...
Code:
Sub NewMain()
    Dim rFound As Range, rPrev As Range, sDomain As String
    
    sDomain = "104fm.com"
    
    Set rPrev = [A1]
    Set rFound = Cells.Find(sDomain)
    Do
        If Not rFound Is Nothing Then
            With Cells(rFound.Row, 1)
                If rFound.Row >= rPrev.Row Then
                    .Value = sDomain
                Else
                    Exit Do
                End If
            End With
        End If
        Set rPrev = rFound
        Set rFound = Cells.FindNext(rFound)
    Loop
End Sub


Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top