Need Excel Expert:-It's very urgent

kashif.special2005

Active Member
Joined
Oct 26, 2009
Messages
443
Hi,

I have value in Column A like below

A1 Callan Owen
A2 Phone:**016269921
A3 Address:**351 Landen Rd, DUBLIN 10, DUBLIN, D10
A4 Callan A
A5 Phone:**014531727
A6 Address:**60 Bangor Rd, DUBLIN 12, DUBLIN, D12
A7 Callan Peter
A8 Phone:**014502538
A9 Address:**7 St Gerards Rd, DUBLIN 12, DUBLIN, D12

I want output like this

Name Phone Address
Callan Owen 016269921 51 Landen Rd, DUBLIN 10, DUBLIN, D10
Callan A 014531727 60 Bangor Rd, DUBLIN 12, DUBLIN, D12
Callan Peter 014502538 7 St Gerards Rd, DUBLIN 12, DUBLIN, D12


Please help.

Thanks & Regards,
Kashif.
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Sorry, I forget to mentioned one point that data in A column till A1 to A5000
in Three sets like A1 to A3 one set name,phone number and address
A4 to A6 second set name,phone number and address, and so on.

Thanks,
Kashif.
 
Upvote 0
Try this :-
Results in column "B".

Code:
[COLOR="Navy"]Sub[/COLOR] MG30May52
[COLOR="Navy"]Dim[/COLOR] Lst [COLOR="Navy"]As[/COLOR] [COLOR="Navy"]Long,[/COLOR] c [COLOR="Navy"]As[/COLOR] [COLOR="Navy"]Long[/COLOR]
[COLOR="Navy"]Dim[/COLOR] n [COLOR="Navy"]As[/COLOR] [COLOR="Navy"]Long[/COLOR]
Lst = Range("A" & rows.Count).End(xlUp).row
    [COLOR="Navy"]For[/COLOR] n = 1 To Lst [COLOR="Navy"]Step[/COLOR] 3
        [COLOR="Navy"]With[/COLOR] Range("A" & n)
            c = c + 1
            Cells(c, 2) = Replace(Replace(Replace(Replace(Join(Application.Transpose(.Resize(3).value)), "Phone", ""), "Address", ""), "*", ""), ":", "")
        [COLOR="Navy"]End[/COLOR] With
     [COLOR="Navy"]Next[/COLOR] n
[COLOR="Navy"]End[/COLOR] [COLOR="Navy"]Sub[/COLOR]
Regards Mick
 
Upvote 0
I am sorry but it is not working

I want that name would be in Column B, Phone number would be Column C and Address would be in Column C.

Like below.


Name Phone Address
Callan Owen 016269921 51 Landen Rd, DUBLIN 10, DUBLIN, D10
Callan A 014531727 60 Bangor Rd, DUBLIN 12, DUBLIN, D12
Callan Peter 014502538 7 St Gerards Rd, DUBLIN 12, DUBLIN, D12


Thanks,
Kashif.
 
Upvote 0
In B1: =IF(OR(LEFT(A1,5)="Phone",LEFT(A1,7)="address"),"",MID(A2,9,12))
In C1: =IF(OR(LEFT(A1,5)="Phone",LEFT(A1,7)="address"),"",MID(A3,11,40))

Fill down.
Then copy the whole range, paste special / values, and filter.
Clean out blanks in column B.

Denis
 
Upvote 0
Will this work for you? Copy down B1:D1
Excel Workbook
ABCD
1Callan OwenCallan Owen016269921351 Landen Rd, DUBLIN 10, DUBLIN, D10
2Phone:**016269921Callan A01453172760 Bangor Rd, DUBLIN 12, DUBLIN, D12
3Address:**351 Landen Rd, DUBLIN 10, DUBLIN, D10Callan Peter0145025387 St Gerards Rd, DUBLIN 12, DUBLIN, D12
4Callan A
5Phone:**014531727
6Address:**60 Bangor Rd, DUBLIN 12, DUBLIN, D12
7Callan Peter
8Phone:**014502538
9Address:**7 St Gerards Rd, DUBLIN 12, DUBLIN, D12
Sheet1
Excel 2007
Cell Formulas
RangeFormula
B1=INDIRECT("$A"&ROW()*3-2)
C1=MID(INDIRECT("$A"&ROW()*3-1),9,99)
D1=MID(INDIRECT("$A"&ROW()*3),11,99)
 
Upvote 0
Code:
Sub Callan()
    
    ' Tools -> Reference -> Microsoft VBScript Regular Expressions 5.5

    Dim i As Long, j As Long
    Dim re As New RegExp, sh As Worksheet
    Dim arr1() As Variant, arr2() As Variant, arr3() As Variant
    
    For i = 1 To 5000
    
        If Cells(i, 1) Like "Callan* Then
            j = j + 1
        End If
        
        Select Case True
            Case Cells(i, 1) Like "Callan*"
                ReDim Preserve arr1(1 To j)
                re.Pattern = "Callan"
                arr1(i) = re.Replace(Cells(i, 1), vbNullString)
            Case Cells(i, 1) Like "Phone*"
                ReDim Preserve arr2(1 To j)
                re.Pattern = "Phone:"
                arr2(i) = re.Replace(Cells(i, 1), vbNullString)
            Case Cells(i, 1) Like "Address*"
                ReDim Preserve arr3(1 To j)
                re.Pattern = "Address:"
                arr3(i) = re.Replace(Cells(i, 1), vbNullString)
        End Select

    Next

    Set sh = Sheets.Add(After:=Sheets(Sheets.Count))
    With sh
        For i = 1 To UBound(arr1)
            .Cells(i, 1) = arr1(i) & " " & arr2(i) & " " & arr3(i)
        Next
    End With
    
End Sub
 
Upvote 0
Hi,

Thanks for reply both formula are working, but there is one problem.

I am sorry, I did not see below some where there is false name above phone number like.These names are not fix may be any names
DENTAL SURGEONS*
REFLEXOLOGY*




MacNally Dr TC BDS NUI
DENTAL SURGEONS*
Phone:**014542984
Address:**144 Sundrive Rd, DUBLIN 12, DUBLIN, D12

McPartlan Geraldine
REFLEXOLOGY*
Phone:**018308480
Address:**11 Claremount Ct, DUBLIN 9, DUBLIN, D9


Thanks,
Kashif.
 
Upvote 0
I wrote reference:
Code:
' Tools -> Reference -> Microsoft VBScript Regular Expressions 5.5
 
Upvote 0

Forum statistics

Threads
1,224,590
Messages
6,179,756
Members
452,940
Latest member
rootytrip

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top