( True) ( False) . , . , , . , MS Excel .
, , , , , 3-10 .
, , 100- 400 , .
'
Dim WorkTime(2)
'
Dim StartTime
'
Dim StopTime
'
Application.ScreenUpdating = True
For i = 1 To 2
'
'
If i = 2 Then _
Application.ScreenUpdating = False
'
StartTime = Time
'
Worksheets(" ").Activate
' 100
' 2020
For y = 1 To 100
For p = 1 To 20
For j = 1 To 20
ActiveSheet.Cells(p, j) = _
Int(Rnd * 100)
Next j
Next p
Next y
'
StopTime = Time
'
'
WorkTime(i) = _
(StopTime - StartTime) * 24 * 60 * 60
Next i
Application.ScreenUpdating = True
MsgBox " ." & Chr(13) + _
" : " & _
WorkTime(1) & " ." & Chr(13) & _
" : " & _
WorkTime(2) & " ."
Selection -
. - . , ( ). .
WorksheetFunction - Excel VBA
WorksheetFunction, Excel, VBA. .
Application
Excel.Application . Word.Application, .
, , , .
. Excel.Application
|
|
Public WithEvents obj_ExApp As Excel.Application
obj_ExApp, - . - . , Excel.Application :
- NewWorkbook -
- SheetActivate -
- SheetBeforeDoubleClick - , , .
- SheetBeforeRightClick - .
- SheetCalculate - , .
- SheetChange - .
- SheetFollowHyperlink - , Microsoft Excel.
- SheetSelectionChange -
- WindowActivate - .
- WindowDeactivate - .
- WindowResize - .
- WorkbookActivate - .
- WorkbookBeforeClose - .
- WorkbookBeforePrint - .
- WorkbookBeforeSave - .
- WorkbookDeactivate - .
- WorkbookNewSheet - .
- WorkbookOpen - .
, , , . - obj_ExApp . , - , obj_ExApp . . , ..
, , AppEvents :
Dim obj_ExcelAppEv As New AppEvents
Sub EventsInit()
Set obj_ExcelAppEv.obj_ExApp = Excel.Application
End Sub
AppEvents .
Public WithEvents obj_ExApp As Excel.Application
Private Sub obj_ExApp_NewWorkbook(ByVal Wb As Workbook)
'
MsgBox " "
End Sub