Loncat ke daftar isi utama

Bagaimana cara membalikkan string teks atau urutan kata di Excel?

Saat Anda menggunakan lembar kerja Excel, bagaimana Anda membalikkan string teks atau urutan kata di Excel? Misalnya, Anda ingin membalik "Excel adalah alat yang berguna bagi kami"To"su rof loot lufesu a si lectxE". Atau terkadang Anda dapat membalik urutan kata seperti "Excel, Word, PowerPoint, OneNote"To"OneNote, PowerPoint, Word, Excel". Biasanya ini agak sulit untuk menyelesaikan masalah ini. Silakan lihat metode berikut:

Membalik string teks dengan User Defined Function

Urutan kata terbalik dipisahkan oleh pemisah tertentu dengan kode VBA

Membalikkan string teks atau urutan kata dengan Kutools for Excel dengan cepat dan mudah


panah gelembung kanan biru Membalik string teks dengan User Defined Function

Misalkan Anda memiliki serangkaian string teks yang ingin Anda balikkan, seperti "tambahkan angka nol di depan di Excel"To"lectxE ni sorez gnidael dda". Anda dapat membalikkan teks dengan langkah-langkah berikut:

1. Tahan ALT + F11 kunci, dan itu membuka Microsoft Visual Basic untuk Aplikasi jendela.

2. Klik Menyisipkan > Modul, dan tempelkan makro berikut di file Moduljendela.

Function Reversestr(str As String) As String
    Reversestr = StrReverse(Trim(str))
End Function

3. Dan kemudian simpan dan tutup kode ini, kembali ke lembar kerja, dan masukkan rumus ini: = reversestr (A2) ke dalam sel kosong untuk meletakkan hasilnya, lihat tangkapan layar:

4. Kemudian seret gagang isian ke bawah untuk menyalin rumus ini, dan teks di sel dihormati sekaligus, lihat tangkapan layar:


panah gelembung kanan biru Urutan kata terbalik dipisahkan oleh pemisah tertentu dengan kode VBA

Jika Anda memiliki daftar kata sel yang dipisahkan dengan koma seperti ini "guru, dokter, murid, pekerja, supir", Dan Anda ingin membalik urutan kata seperti ini"mengemudi, pekerja, pelajar, dokter, guru". Anda juga dapat menggunakan ikuti VBA untuk menyelesaikannya.

1. Tahan ALT + F11 kunci, dan itu membuka Microsoft Visual Basic untuk Aplikasi jendela.

2. Klik Menyisipkan > Modul, dan tempelkan makro berikut di file Modul jendela.

Sub ReverseWord()
'Updateby Extendoffice
Dim Rng As Range
Dim WorkRng As Range
Dim Sigh As String
On Error Resume Next
xTitleId = "KutoolsforExcel"
Set WorkRng = Application.Selection
Set WorkRng = Application.InputBox("Range", xTitleId, WorkRng.Address, Type:=8)
Sigh = Application.InputBox("Symbol interval", xTitleId, ",", Type:=2)
For Each Rng In WorkRng
    strList = VBA.Split(Rng.Value, Sigh)
    xOut = ""
    For i = UBound(strList) To 0 Step -1
        xOut = xOut & strList(i) & Sigh
    Next
    Rng.Value = xOut
Next
End Sub

3. Lalu tekan F5 kunci, dialog ditampilkan, pilih rentang untuk dikerjakan. Lihat tangkapan layar:

4. Lalu tekan Ok, dialog lain muncul bagi Anda untuk menentukan pemisah yang ingin Anda ubah kata-katanya berdasarkan, lihat tangkapan layar:

5. Kemudian klik OK, dan Anda dapat melihat kata-kata yang dipilih dibalik, lihat tangkapan layar:


panah gelembung kanan biru Membalikkan string teks atau urutan kata dengan Kutools for Excel dengan cepat dan mudah

Grafik Kutools untuk Excel'S Urutan Teks Terbalik dapat membantu Anda dengan cepat dan nyaman untuk membalikkan berbagai string teks. Itu dapat melakukan operasi berikut:

Membalik teks dari kanan ke kiri, seperti "ketuk beberapa kata"To"sdrow emo pat"

Membalik teks dipisahkan dengan spasi atau karakter spesifik lainnya, seperti “anggur jeruk apel"To"apel jeruk anggur"

Kutools untuk Excel : dengan lebih dari 300 add-in Excel yang praktis, gratis untuk dicoba tanpa batasan dalam 30 hari

Membalik teks dari kanan ke kiri:

1. Pilih rentang yang ingin Anda balikkan.

2. Klik Kutools > Alat teks > Urutan Teks Terbalik, lihat tangkapan layar:

3. di Teks terbalik kotak dialog, pilih opsi yang tepat dari alat pemisah yang sesuai dengan nilai sel. Dan Anda dapat melihat hasil dari Panel pratinjau. Lihat tangkapan layar:

 Unduh dan uji coba gratis Kutools untuk Excel Sekarang!


Membalik teks dipisahkan oleh spasi atau karakter spesifik lainnya:

Fitur ini juga dapat membantu Anda untuk membalikkan string teks yang dipisahkan oleh karakter tertentu.

1. Pilih sel dan terapkan utilitas ini dengan mengklik Kutools > Teks > Urutan Teks Terbalik.

2. Dalam majalah Teks terbalik kotak dialog, pilih pemisah yang memisahkan nilai sel yang ingin Anda balikkan kata-kata berdasarkan, lihat tangkapan layar:

3. Lalu klik Ok or Mendaftar, kata-kata dalam sel telah dibalik sekaligus. Lihat tangkapan layar:

Note: Memeriksa Lewati non-teks sel untuk mencegah Anda membalikkan angka dalam rentang yang dipilih.

Untuk mengetahui lebih banyak tentang fungsi ini, silakan kunjungi Urutan Teks Terbalik.

Unduh dan uji coba gratis Kutools untuk Excel Sekarang!


panah gelembung kanan biru Demo: Membalikkan string teks berdasarkan pemisah tertentu dengan Kutools for Excel

Kutools untuk Excel: dengan lebih dari 300 add-in Excel yang praktis, gratis untuk dicoba tanpa batasan dalam 30 hari. Unduh dan uji coba gratis Sekarang!

Artikel terkait:

Bagaimana cara membalik nama depan dan belakang dalam sel di Excel?

Alat Produktivitas Kantor Terbaik

🤖 Kutools AI Ajudan: Merevolusi analisis data berdasarkan: Eksekusi Cerdas   |  Hasilkan Kode  |  Buat Rumus Khusus  |  Analisis Data dan Hasilkan Grafik  |  Aktifkan Fungsi Kutools...
Fitur Populer: Temukan, Sorot, atau Identifikasi Duplikat   |  Hapus Baris Kosong   |  Gabungkan Kolom atau Sel tanpa Kehilangan Data   |   Putaran tanpa Formula ...
Pencarian Super: VLookup Beberapa Kriteria    VLookup Nilai Berganda  |   VLookup di Beberapa Lembar   |   Pencarian Fuzzy ....
Daftar Drop-down Lanjutan: Buat Daftar Drop Down dengan Cepat   |  Daftar Drop Down yang Bergantung   |  Multi-pilih Drop Down List ....
Manajer Kolom: Tambahkan Jumlah Kolom Tertentu  |  Pindahkan Kolom  |  Alihkan Status Visibilitas Kolom Tersembunyi  |  Bandingkan Rentang & Kolom ...
Fitur Unggulan: Fokus Kisi   |  Tampilan Desain   |   Bar Formula Besar    Manajer Buku Kerja & Lembar   |  Perpustakaan Sumberdaya (Teks otomatis)   |  Pemetik tanggal   |  Gabungkan Lembar Kerja   |  Enkripsi/Dekripsi Sel    Kirim Email berdasarkan Daftar   |  Filter Super   |   Filter Khusus (filter tebal/miring/coret...) ...
15 Perangkat Teratas12 Teks Tools (Tambahkan Teks, Hapus Karakter, ...)   |   50 + Grafik jenis (Gantt Chart, ...)   |   40+ Praktis Rumus (Hitung usia berdasarkan ulang tahun, ...)   |   19 Insersi Tools (Masukkan Kode QR, Sisipkan Gambar dari Jalur, ...)   |   12 Konversi Tools (Angka ke Kata, Konversi Mata Uang, ...)   |   7 Gabungkan & Pisahkan Tools (Lanjutan Gabungkan Baris, Pisahkan Sel, ...)   |   ... dan banyak lagi

Tingkatkan Keterampilan Excel Anda dengan Kutools for Excel, dan Rasakan Efisiensi yang Belum Pernah Ada Sebelumnya. Kutools for Excel Menawarkan Lebih dari 300 Fitur Lanjutan untuk Meningkatkan Produktivitas dan Menghemat Waktu.  Klik Di Sini untuk Mendapatkan Fitur yang Paling Anda Butuhkan...

Deskripsi Produk


Tab Office Membawa antarmuka Tab ke Office, dan Membuat Pekerjaan Anda Jauh Lebih Mudah

  • Aktifkan pengeditan dan pembacaan tab di Word, Excel, PowerPoint, Publisher, Access, Visio, dan Project.
  • Buka dan buat banyak dokumen di tab baru di jendela yang sama, bukan di jendela baru.
  • Meningkatkan produktivitas Anda sebesar 50%, dan mengurangi ratusan klik mouse untuk Anda setiap hari!

 

Comments (19)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Ik zoek een manier om een heleboel woorden in 'rijm-fabetische volgorde' te zetten. Dus de laatste letters van het woord moeten in alfabetische volgorde. Iemand enig idee? VrGr Amanda
This comment was minimized by the moderator on the site
This is truly a great help ... Thank you so much
This comment was minimized by the moderator on the site
awesome very helpful thanks for sharing the details
This comment was minimized by the moderator on the site
Thank you very much. This code helped my friend in a very good way
This comment was minimized by the moderator on the site
Is it possible to start the reverse at a certain character length (for the user-defined function or VBA code)? For example, reverse cell A1 values starting after the character count equal to B1 value. So if B1 is 10 characters reverse will start at characters 11+ in A1..
This comment was minimized by the moderator on the site
I found that the original Sub gave out the results with additional sigh at the end of all selected cells. So I fixed this part. For i = UBound(strList) To 0 Step -1 If i > 0 Then xOut = xOut & strList(i) & Sigh Else xOut = xOut & strList(i) Next Rng.Value = xOut
This comment was minimized by the moderator on the site
It's possible to reverse text using formula, it is repetitive and limited to how far you are prepared to go and subject to number of characters excel will allow in the formula bar. Max length of text will be 30 chars and is in cell A1. Cell B1 would read: =TRIM(MID(LEFT(A1&REPT(" ",31),31),30,1)&MID(LEFT(A1&REPT(" ",31),31),29,1)&MID(LEFT(A1&REPT(" ",31),31),28,1)&MID(LEFT(A1&REPT(" ",31),31),27,1)&MID(LEFT(A1&REPT(" ",31),31),26,1)&MID(LEFT(A1&REPT(" ",31),31),25,1)&MID(LEFT(A1&REPT(" ",31),31),24,1)&MID(LEFT(A1&REPT(" ",31),31),23,1)&MID(LEFT(A1&REPT(" ",31),31),22,1)&MID(LEFT(A1&REPT(" ",31),31),21,1)&MID(LEFT(A1&REPT(" ",31),31),20,1)&MID(LEFT(A1&REPT(" ",31),31),19,1)&MID(LEFT(A1&REPT(" ",31),31),18,1)&MID(LEFT(A1&REPT(" ",31),31),17,1)&MID(LEFT(A1&REPT(" ",31),31),16,1)&MID(LEFT(A1&REPT(" ",31),31),15,1)&MID(LEFT(A1&REPT(" ",31),31),14,1)&MID(LEFT(A1&REPT(" ",31),31),13,1)&MID(LEFT(A1&REPT(" ",31),31),12,1)&MID(LEFT(A1&REPT(" ",31),31),11,1)&MID(LEFT(A1&REPT(" ",31),31),10,1)&MID(LEFT(A1&REPT(" ",31),31),9,1)&MID(LEFT(A1&REPT(" ",31),31),8,1)&MID(LEFT(A1&REPT(" ",31),31),7,1)&MID(LEFT(A1&REPT(" ",31),31),6,1)&MID(LEFT(A1&REPT(" ",31),31),5,1)&MID(LEFT(A1&REPT(" ",31),31),4,1)&MID(LEFT(A1&REPT(" ",31),31),3,1)&MID(LEFT(A1&REPT(" ",31),31),2,1)&MID(LEFT(A1&REPT(" ",31),31),1,1)) Result: A1: Duncan Sullivan-Shaw B1: wahS-navilluS nacnuD Basically your text in cell A1 becomes 31 characters long by adding enough spaces to enable this, and each character is read singularly from right to left until you reach the first character. This will result in your reversed text containing leading spaces, which the TRIM command removes for you. To reduce or increase the length you would remove or add each statement. The number within the REPT statement should be 1 more than the maximum length you are working to and your first MID statement will start at the maximum length working down to 1.
This comment was minimized by the moderator on the site
hi all, i don't have Kutools to reverse a character of text, if anybody has this tools and want to help me, please send me email to send my file to you for reverse. my email is: [b][b][/b][/b] with regards,
This comment was minimized by the moderator on the site
please go through the instructions give by the extend office website after searching with google by reverse string in excel.
This comment was minimized by the moderator on the site
Hi I would like to reverse Dates. 20/11/2015 to 2015/11/20 Any Help? Thanks
This comment was minimized by the moderator on the site
For dates all you need to do is change the format of the cell to the format needed. Right click on the cell you would like to reverse and select format cell. Select Date under the category section and change the location from wherever you are to US or Czech or another country that may use the format you are interested in. Then pick the one that matches your requirements.
This comment was minimized by the moderator on the site
thank you its really useful for me :roll:
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations