EXCEL TOOLS
Excel Add-ins ที่พัฒนาโดยคุณสันติพงศ์ ณสุย (MVP Excel 2010-2020) ด้วยภาษา C# เพื่อแก้ไขปัญหาไฟล์ใหญ่ คำนวณนาน ทำงานช้า จัดการข้อมูลต่าง ๆ ที่ทำงานประจำวันได้อย่างสะดวกรวดเร็ว สนใจคลิกไปดูได้ที่นี่ครับ => Excel Tools
Excel Add-ins ที่พัฒนาโดยคุณสันติพงศ์ ณสุย (MVP Excel 2010-2020) ด้วยภาษา C# เพื่อแก้ไขปัญหาไฟล์ใหญ่ คำนวณนาน ทำงานช้า จัดการข้อมูลต่าง ๆ ที่ทำงานประจำวันได้อย่างสะดวกรวดเร็ว สนใจคลิกไปดูได้ที่นี่ครับ => Excel Tools
[code]
และปิดด้วย [/code]
ตัวอย่างเช่น [code]dim r as range[/code]
เพื่อให้แตกต่างจากข้อความทั่วไป สะดวกในการอ่านและทดสอบ (คลิกเพื่อดูตัวอย่าง)Code: Select all
Sub clear()
Range("A1:C10").Select
Selection.ClearContents
Range("A1").Select
End Sub
Code: Select all
Sub clear()
For Each Cell In Range("A1:C10")
If Cell.Value <> "ห" Then Cell.ClearContents
Next Cell
End Sub
Code: Select all
Sub CleanData()
Dim O As Range, p As Integer
Dim i As String, u As String
With Sheets("Sheet1")
For Each O In .Range("a1", .Range("a" & .Rows.Count).End(xlUp))
u = ""
For p = 1 To Len(O)
i = Mid(O, p, 1)
If i Like "[ห]" _
Then
u = u & i
End If
Next p
O.Offset(0, 0).Value = u
O.Offset(0, 1).Value = u
O.Offset(0, 2).Value = u
Next O
End With
End Sub