Results 1 to 2 of 2

Splitting data in Cells

Threaded View

james_edstrom Hi Everyone, I have a load... 12-10-2009, 07:24 AM
teylyn Re: Splitting data in Cells 12-10-2009, 07:56 AM
  1. #1
    Registered User
    Join Date
    01-08-2009
    Location
    UK
    MS-Off Ver
    Excel 2003
    Posts
    7
    Hi Everyone,

    I have a load of cells that contain email addresses, and i need to split these addresses down, to show only the domain names.

    Is there a quick way of doing this, or do i need to click into every cell and delete the 1st half of the address?

    Many Thanks

    James

    Hi Everyone,

    I have a load of cells that contain email addresses, and i need to split these addresses down, to show only the domain names.

    Is there a quick way of doing this, or do i need to click into every cell and delete the 1st half of the address?

    Many Thanks

    James

    James try text to column option in data tools to split the cells.

    tek9step

    Hi james_edstrom
    try...
    Option Explicit
    Sub ptest()
        Dim rng As Range, p As Range
        Set rng = ActiveSheet.Range("B1:B12")
        With CreateObject("VBScript.RegExp")
            .MultiLine = False
            .Global = False
            .IgnoreCase = True
            .Pattern = "^([a-z0-9_\.\-]+)\@(([a-z0-9\-]+\.)+)([a-z]+)$"
            For Each p In rng
                If .Test(p) = True Then
                    p.Offset(0, 1) = "Valid"
                    p.Offset(0, 2) = .Replace(p, "$1")
                    p.Offset(0, 3) = .Replace(p, "$2")
                    p.Offset(0, 4) = .Replace(p, "$4")
                Else
                    p.Offset(0, 1) = "InValid"
                End If
            Next
        End With
    End Sub
    adjust ranges to suit

    Hi,

    How about this:

    =RIGHT(A1,LEN(A1)-FIND("@",A1))

    or use data > text to columns > delimited > custom > @

    oopsie, there's some double posting going on. Mods, please merge?

    oopsie, there's some double posting going on. Mods, please merge?

    Thanks everyone, very helpful!
    Last edited by dominicb; 12-10-2009 at 07:56 AM. Reason: Double Posts

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1