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 Counter()
If Now > Date + TimeValue("10:00:00") Then
Application.OnTime Date + TimeValue("10:00:00"), "Counter", , True
Else
xxx Wait xxx
End If
If Now > Date + TimeValue("17:00:00") Then
Application.OnTime Date + TimeValue("17:00:00"), "Counter", , False
CurrBook.Close
Exit Sub
End If
Application.OnTime Now + TimeValue("00:00:10"), "Counter"
'nTime = Now + TimeValue("00:00:10")
'Application.OnTime nTime, "Counter"
Call Sound
End Sub
Code: Select all
Dim xxx As Date
Sub Counter()
If Now < Date + TimeValue("10:00:00") Then
xxx = Date + TimeValue("10:00:00") - Now
End If
If Now > Date + TimeValue("10:00:00") Then
Application.OnTime Date + TimeValue("10:00:00"), "Counter", , True
Else
Application.Wait xxx
End If
'Other code
End Sub
Code: Select all
Public Ntime As Date, Nwait As Date
'Public Non As Date, Noff As Date
'Public CurrBook As Workbook, CheckFile As Boolean
Sub Counter()
Dim Non As Date, Noff As Date
Dim CurrBook As Workbook, CheckFile As Boolean
Set CurrBook = ThisWorkbook
Ntime = Now + TimeValue("00:00:01")
Non = Date + TimeValue("08:00:00")
Noff = Date + TimeValue("08:00:10")
If Now < Non Then
Nwait = Non - Now
Application.Wait Now + Nwait
End If
If Now > Noff Then
On Error Resume Next
Application.OnTime Ntime, "Counter", , False
CurrBook.Save
CurrBook.Close
Exit Sub
End If
Call Sound
Call UseSpeech
Call Sort_Level
Call C_Copy
Call Col_Scale
Application.OnTime Ntime, "Counter", , True
End Sub