ไปยังเนื้อหาหลัก

วิธีย้อนกลับสตริงข้อความหรือลำดับคำใน Excel

เมื่อคุณใช้แผ่นงาน Excel คุณจะย้อนกลับสตริงข้อความหรือลำดับคำใน Excel ได้อย่างไร ตัวอย่างเช่นคุณต้องการย้อนกลับ“Excel เป็นเครื่องมือที่มีประโยชน์สำหรับเรา"ถึง"su rof ยกเค้า lufesu a si lecxE”. หรือบางครั้งคุณอาจกลับลำดับคำเช่น“Excel, Word, PowerPoint, OneNote"ถึง"OneNote, PowerPoint, Word, Excel”. โดยปกติการแก้ปัญหานี้ค่อนข้างยาก โปรดดูวิธีการต่อไปนี้:

ย้อนกลับสตริงข้อความด้วย User Defined Function

ลำดับคำย้อนหลังคั่นด้วยตัวคั่นเฉพาะด้วยรหัส VBA

ย้อนกลับสตริงข้อความหรือลำดับคำด้วย Kutools for Excel อย่างรวดเร็วและง่ายดาย


ลูกศรสีฟ้าฟองขวา ย้อนกลับสตริงข้อความด้วย User Defined Function

สมมติว่าคุณมีสตริงข้อความหลายช่วงที่คุณต้องการย้อนกลับเช่น“เพิ่มเลขศูนย์นำหน้าใน Excel"ถึง"lecxE นิเซอเรซ gnidael dda”. คุณสามารถย้อนกลับข้อความโดยทำตามขั้นตอนต่อไปนี้:

1. กด ALT + F11 และจะเปิดไฟล์ Microsoft Visual Basic สำหรับแอปพลิเคชัน หน้าต่าง

2. คลิก สิ่งที่ใส่เข้าไป > โมดูลและวางมาโครต่อไปนี้ในไฟล์ โมดูลหน้าต่าง

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

3. จากนั้นบันทึกและปิดรหัสนี้กลับไปที่แผ่นงานและป้อนสูตรนี้: = reverseestr (A2) ลงในเซลล์ว่างเพื่อใส่ผลลัพธ์ดูภาพหน้าจอ:

4. จากนั้นลากที่จับเติมลงเพื่อคัดลอกสูตรนี้และข้อความในเซลล์จะได้รับการเคารพในครั้งเดียวดูภาพหน้าจอ:


ลูกศรสีฟ้าฟองขวา ลำดับคำย้อนหลังคั่นด้วยตัวคั่นเฉพาะด้วยรหัส VBA

หากคุณมีรายการคำของเซลล์ซึ่งคั่นด้วยเครื่องหมายจุลภาคดังนี้ "ครูหมอนักเรียนคนงานคนขับรถ” และคุณต้องการกลับลำดับคำเช่นนี้“ไดรฟ์คนงานนักเรียนหมอครู”. คุณยังสามารถใช้ follow VBA เพื่อแก้ปัญหาได้

1. กด ALT + F11 และจะเปิดไฟล์ Microsoft Visual Basic สำหรับแอปพลิเคชัน หน้าต่าง

2. คลิก สิ่งที่ใส่เข้าไป > โมดูลและวางมาโครต่อไปนี้ในไฟล์ โมดูล หน้าต่าง

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. จากนั้นกด F5 คีย์กล่องโต้ตอบจะปรากฏขึ้นโปรดเลือกช่วงที่จะใช้งาน ดูภาพหน้าจอ:

4. จากนั้นกด Okกล่องโต้ตอบอื่นจะปรากฏขึ้นเพื่อให้คุณระบุตัวคั่นที่คุณต้องการย้อนกลับคำตามดูภาพหน้าจอ:

5. จากนั้นคลิก OKและคุณจะเห็นคำที่เลือกกลับด้านดูภาพหน้าจอ:


ลูกศรสีฟ้าฟองขวา ย้อนกลับสตริงข้อความหรือลำดับคำด้วย Kutools for Excel อย่างรวดเร็วและง่ายดาย

พื้นที่ Kutools สำหรับ Excel's ลำดับข้อความย้อนกลับ สามารถช่วยให้คุณย้อนกลับสตริงข้อความต่างๆได้อย่างรวดเร็วและสะดวก สามารถดำเนินการต่อไปนี้:

ย้อนกลับข้อความจากขวาไปซ้ายเช่น“แตะคำบางคำ"ถึง"sdrow emos แพท";

ย้อนกลับข้อความจะคั่นด้วยช่องว่างหรืออักขระเฉพาะอื่น ๆ เช่น“องุ่นส้มแอปเปิ้ล"ถึง"แอปเปิ้ลส้มองุ่น";

Kutools สำหรับ Excel : ด้วย Add-in ของ Excel ที่มีประโยชน์มากกว่า 300 รายการทดลองใช้ฟรีโดยไม่มีข้อ จำกัด ใน 30 วัน

ย้อนกลับข้อความจากขวาไปซ้าย:

1. เลือกช่วงที่คุณต้องการย้อนกลับ

2. คลิก Kutools > เครื่องมือข้อความ > ลำดับข้อความย้อนกลับดูภาพหน้าจอ:

3. ใน ข้อความย้อนกลับ กล่องโต้ตอบเลือกตัวเลือกที่เหมาะสมจาก เครื่องสกัด ซึ่งสอดคล้องกับค่าของเซลล์ และคุณสามารถดูผลลัพธ์จากไฟล์ บานหน้าต่างแสดงตัวอย่าง. ดูภาพหน้าจอ:

 ดาวน์โหลดและทดลองใช้ Kutools for Excel ฟรีทันที!


ย้อนกลับข้อความจะถูกคั่นด้วยช่องว่างหรืออักขระเฉพาะอื่น ๆ :

คุณลักษณะนี้ยังช่วยให้คุณสามารถย้อนกลับสตริงข้อความซึ่งคั่นด้วยอักขระเฉพาะได้

1. เลือกเซลล์และใช้ยูทิลิตี้นี้โดยคลิก Kutools > ข้อความ > ลำดับข้อความย้อนกลับ.

2. ตัว Vortex Indicator ได้ถูกนำเสนอลงในนิตยสาร ข้อความย้อนกลับ กล่องโต้ตอบเลือกตัวคั่นซึ่งแยกค่าของเซลล์ที่คุณต้องการกลับคำตามดูภาพหน้าจอ:

3. จากนั้นคลิก Ok or ใช้คำในเซลล์ถูกกลับรายการพร้อมกัน ดูภาพหน้าจอ:

หมายเหตุ: กำลังตรวจสอบ ข้ามข้อความที่ไม่ใช่ เซลล์เพื่อป้องกันไม่ให้คุณย้อนกลับตัวเลขในช่วงที่เลือก

หากต้องการทราบข้อมูลเพิ่มเติมเกี่ยวกับฟังก์ชันนี้โปรดไปที่ ลำดับข้อความย้อนกลับ.

ดาวน์โหลดและทดลองใช้ Kutools for Excel ฟรีทันที!


ลูกศรสีฟ้าฟองขวา การสาธิต: ย้อนกลับสตริงข้อความตามตัวคั่นเฉพาะด้วย Kutools for Excel

Kutools สำหรับ Excel: ด้วย Add-in ของ Excel ที่มีประโยชน์มากกว่า 300 รายการให้ทดลองใช้ฟรีโดยไม่มีข้อ จำกัด ใน 30 วัน ดาวน์โหลดและทดลองใช้ฟรีทันที!

บทความที่เกี่ยวข้อง:

วิธีพลิกชื่อและนามสกุลในเซลล์ใน Excel

สุดยอดเครื่องมือเพิ่มผลผลิตในสำนักงาน

🤖 Kutools AI ผู้ช่วย: ปฏิวัติการวิเคราะห์ข้อมูลโดยยึดตาม: การดำเนินการที่ชาญฉลาด   |  สร้างรหัส  |  สร้างสูตรที่กำหนดเอง  |  วิเคราะห์ข้อมูลและสร้างแผนภูมิ  |  เรียกใช้ฟังก์ชัน Kutools...
คุณสมบัติยอดนิยม: ค้นหา เน้น หรือระบุรายการที่ซ้ำกัน   |  ลบแถวว่าง   |  รวมคอลัมน์หรือเซลล์โดยไม่สูญเสียข้อมูล   |   รอบโดยไม่มีสูตร ...
การค้นหาขั้นสูง: VLookup หลายเกณฑ์    VLookup หลายค่า  |   VLookup ข้ามหลายแผ่น   |   การค้นหาที่ไม่ชัดเจน ....
รายการแบบเลื่อนลงขั้นสูง: สร้างรายการแบบหล่นลงอย่างรวดเร็ว   |  รายการแบบหล่นลงขึ้นอยู่กับ   |  เลือกหลายรายการแบบหล่นลง ....
ผู้จัดการคอลัมน์: เพิ่มจำนวนคอลัมน์เฉพาะ  |  ย้ายคอลัมน์  |  สลับสถานะการมองเห็นของคอลัมน์ที่ซ่อนอยู่  |  เปรียบเทียบช่วงและคอลัมน์ ...
คุณสมบัติเด่น: กริดโฟกัส   |  มุมมองการออกแบบ   |   บาร์สูตรใหญ่    สมุดงานและตัวจัดการชีต   |  ห้องสมุดทรัพยากร (ข้อความอัตโนมัติ)   |  เลือกวันที่   |  รวมแผ่นงาน   |  เข้ารหัส/ถอดรหัสเซลล์    ส่งอีเมลตามรายการ   |  ซุปเปอร์ฟิลเตอร์   |   ตัวกรองพิเศษ (กรองตัวหนา/ตัวเอียง/ขีดทับ...) ...
ชุดเครื่องมือ 15 อันดับแรก12 ข้อความ เครื่องมือ (เพิ่มข้อความ, ลบอักขระ, ... )   |   50 + แผนภูมิ ประเภท (แผนภูมิ Gantt, ... )   |   40+ ใช้งานได้จริง สูตร (คำนวณอายุตามวันเกิด, ... )   |   19 การแทรก เครื่องมือ (ใส่ QR Code, แทรกรูปภาพจากเส้นทาง, ... )   |   12 การแปลง เครื่องมือ (ตัวเลขเป็นคำ, การแปลงสกุลเงิน, ... )   |   7 ผสานและแยก เครื่องมือ (แถวรวมขั้นสูง, แยกเซลล์, ... )   |   ... และอื่น ๆ

เพิ่มพูนทักษะ Excel ของคุณด้วย Kutools สำหรับ Excel และสัมผัสประสิทธิภาพอย่างที่ไม่เคยมีมาก่อน Kutools สำหรับ Excel เสนอคุณสมบัติขั้นสูงมากกว่า 300 รายการเพื่อเพิ่มประสิทธิภาพและประหยัดเวลา  คลิกที่นี่เพื่อรับคุณสมบัติที่คุณต้องการมากที่สุด...

รายละเอียด


แท็บ Office นำอินเทอร์เฟซแบบแท็บมาที่ Office และทำให้งานของคุณง่ายขึ้นมาก

  • เปิดใช้งานการแก้ไขและอ่านแบบแท็บใน Word, Excel, PowerPoint, ผู้จัดพิมพ์, Access, Visio และโครงการ
  • เปิดและสร้างเอกสารหลายรายการในแท็บใหม่ของหน้าต่างเดียวกันแทนที่จะเป็นในหน้าต่างใหม่
  • เพิ่มประสิทธิภาพการทำงานของคุณ 50% และลดการคลิกเมาส์หลายร้อยครั้งให้คุณทุกวัน!

 

Comments (20)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
=UNIRTEXTO("";1;EXT.TEXTO(A2;{20\19\18\17\16\15\14\13\12\11\10\9\8\7\6\5\4\3\2\1};1))
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.
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