muhammad susanto,
Here is a macro solution for you to consider.
Sample raw data in the active sheet:
Excel 2007
<colgroup><col style="width: 25pxpx"><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]1[/TD]
[TD="bgcolor: #FFFFFF"]data[/TD]
[TD="bgcolor: #FFFFFF"]desired result[/TD]
[TD="align: center"]2[/TD]
[TD="bgcolor: #FFFFFF"]JALAN RIAU NO. 38B, KOTA PEKANBARU,,,,[/TD]
[TD="bgcolor: #FFFFFF, align: right"][/TD]
[TD="align: center"]3[/TD]
[TD="bgcolor: #FFFFFF"]Jalan Dr. Sutomo Nomor 62, Pekanbaru,Pekanbaru,PEKAN BARU KOTA,PEKAN BARU,R I A U[/TD]
[TD="bgcolor: #FFFFFF, align: right"][/TD]
[TD="align: center"]4[/TD]
[TD="bgcolor: #FFFFFF"]Jl. Beringin (gobah) Perum guru SD 10 Kec. Sail Pekanbaru,Sail,SAIL,PEKAN BARU,R I A U[/TD]
[TD="bgcolor: #FFFFFF, align: right"][/TD]
[TD="align: center"]5[/TD]
[TD="bgcolor: #FFFFFF"]PERUMNAS POLTAK BROTHERS H NO. 10 KULIM,KULIM,BUKIT RAYA,PEKAN BARU,R I A U[/TD]
[TD="bgcolor: #FFFFFF, align: right"][/TD]
[TD="align: center"]6[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
</tbody>
Sheet1
After the macro:
Excel 2007
<colgroup><col style="width: 25pxpx"><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]1[/TD]
[TD="bgcolor: #FFFFFF"]data[/TD]
[TD="bgcolor: #FFFFFF"]desired result[/TD]
[TD="align: center"]2[/TD]
[TD="bgcolor: #FFFFFF"]JALAN RIAU NO. 38B, KOTA PEKANBARU,,,,[/TD]
[TD="bgcolor: #FFFFFF"]Pekanbaru[/TD]
[TD="align: center"]3[/TD]
[TD="bgcolor: #FFFFFF"]Jalan Dr. Sutomo Nomor 62, Pekanbaru,Pekanbaru,PEKAN BARU KOTA,PEKAN BARU,R I A U[/TD]
[TD="bgcolor: #FFFFFF"]Pekanbaru[/TD]
[TD="align: center"]4[/TD]
[TD="bgcolor: #FFFFFF"]Jl. Beringin (gobah) Perum guru SD 10 Kec. Sail Pekanbaru,Sail,SAIL,PEKAN BARU,R I A U[/TD]
[TD="bgcolor: #FFFFFF"]Pekanbaru[/TD]
[TD="align: center"]5[/TD]
[TD="bgcolor: #FFFFFF"]PERUMNAS POLTAK BROTHERS H NO. 10 KULIM,KULIM,BUKIT RAYA,PEKAN BARU,R I A U[/TD]
[TD="bgcolor: #FFFFFF"]Pekanbaru[/TD]
[TD="align: center"]6[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
</tbody>
Sheet1
Please TEST this FIRST in a COPY of your workbook (always make a backup copy before trying new code, you never know what you might lose).
1. Copy the below code
2. Open your NEW workbook
3. Press the keys
ALT +
F11 to open the Visual Basic Editor
4. Press the keys
ALT +
I to activate the Insert menu
5. Press
M to insert a Standard Module
6. Where the cursor is flashing, paste the code
7. Press the keys
ALT +
Q to exit the Editor, and return to Excel
8. To run the macro from Excel press
ALT +
F8 to display the Run Macro Dialog. Double Click the macro's name to Run it.
Code:
Option Compare Text
Sub Pull_Pekanbaru()
' hiker95, 09/13/2015, ME884929
Dim c As Range
Application.ScreenUpdating = False
With ActiveSheet
For Each c In .Range("A2", .Range("A" & Rows.Count).End(xlUp))
If InStr(c, "Pekanbaru") Or InStr(c, "Pekan Baru") Then
c.Offset(, 1).Value = "Pekanbaru"
End If
Next c
End With
Application.ScreenUpdating = True
End Sub
Before you use the macro with
Excel 2007 or newer, save your workbook, Save As, a macro enabled workbook with the file extension
.xlsm, and, answer the "do you want to enable macros" question as "yes" or "OK" (depending on the button label for your version of Excel) the next time you open your workbook.
Then run the
Pull_Pekanbaru macro.