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 ตั้งค่าเนื้อหา()
Dim rng As Range
Application.ScreenUpdating = False
Sheets(Array("C1T1", "C2T1", "C3T1", "C4T1", "C5T1")).Select
Set rng = Range("E7:X57,AB8:AC57,AG8:AG57,AJ8:AK57")
rng.Borders.LineStyle = xlContinuous
rng.Font.Name = "Angsana New"
rng.Font.Size = 14
rng.HorizontalAlignment = xlCenter
rng.Borders(xlInsideHorizontal).LineStyle = xlContinuous
Application.ScreenUpdating = True
End Sub
Code: Select all
Dim rng As Range
Application.ScreenUpdating = False
Sheets(Array("C1T1", "C2T1", "C3T1", "C4T1", "C5T1")).Select
Range("E7:X57,AB8:AC57,AG8:AG57,AJ8:AK57").Select
Set rng = Selection
rng.Borders.LineStyle = xlContinuous
rng.Font.Name = "Angsana New"
rng.Font.Size = 14
rng.HorizontalAlignment = xlCenter
rng.Borders(xlInsideHorizontal).LineStyle = xlContinuous
Sheets(1).Select
Application.ScreenUpdating = True
ขอบคุณมากครับsnasui wrote: ตัวอย่าง Code ครับ
Code: Select all
Dim rng As Range Application.ScreenUpdating = False Sheets(Array("C1T1", "C2T1", "C3T1", "C4T1", "C5T1")).Select Range("E7:X57,AB8:AC57,AG8:AG57,AJ8:AK57").Select Set rng = Selection rng.Borders.LineStyle = xlContinuous rng.Font.Name = "Angsana New" rng.Font.Size = 14 rng.HorizontalAlignment = xlCenter rng.Borders(xlInsideHorizontal).LineStyle = xlContinuous Sheets(1).Select Application.ScreenUpdating = True