Ͳ

26.08.2009
!

27.08.2009
?


.

VBA _





( 1)
.















1.




2.2 .

, . .. .

:
= .




:
= .





2.3 .
:
Pentium 233
32
200
0,5
VGA 800600

:
Pentium II 366 /Celeron
64
2.5
1-2-4
SVGA 800600
1024768.

, , .


3.


Excel97
Visual Basic for Application. Excel97 :
. . . .
. . - . .
. . - . . .
. .


VBA , , , , , ..
.
Microsoft Office.

3.2. .

( ) :







, ,
/


,



- /- , /- , - . .

. Ҩ





Ҩ

-

3.

.
. , . .



.




, ,
/







,



3.
- /- , /- , - . .

Ҩ
Ҩ
.
Ҩ
.
. Ҩ
.
.


-
4.
. :

Ҩ




I- I-
II - II-
III- III-
IV- IV-





. .


. .
ר
ר
ר
ר



5.

Ҩ. . :

Ҩ



/


/



6.

.
.






































































































3.4 .

. - . :


- 


01/02/00 
500 


02/02/00 
600 


03/03/00 
700 


04/04/00 
800 


05/05/00 
900 


06/06/00 
1000 


07/07/00 
1100 


08/08/00 
1200 


01/02/00 
100 


02/02/00 
10 


03/03/00 
15 


04/04/00 
16 


05/05/00 
17 


08/08/00 
18 


08/09/00 
19 


01/02/00 
1000 



7995 



.
. .


.


.
Excel -97 .
, , . , .
, .












Microsoft OFFICE97 . .- 1998 .






2. . Microsoft Office - .- 1999 .

3. . . Visual Basic 5 BHV-- 1998 .

4. .. Excel Windows 95 BHV-- 1998 .

5. .. Microsoft Office Windows 95 BHV-- 1998 .

6... IBM PC . - : , 1991.
7.. Windows 95 BHV-- 1998 .

8 . . ,.. Microsoft Office BHV-- 1998 .




















.


Dim As String
Dim As String
Dim BOX
Dim
Dim 1 As String
Dim
Private Sub ComboBox1_Change()
Windows("" & Year(Date)).Activate
If ComboBox1.ListIndex = -1 Then
Exit Sub
End If
a = ComboBox1.ListIndex
2.Visible = False
.Visible = False
.Visible = False
.Visible = True
If Len(Worksheets().Range("A1")) = 0 Then
ComboBox1.Visible = False
Windows("" & Year(Date)).Activate
= Worksheets().Range("C1")
= Worksheets().Range("B1")
= Worksheets().Range("A1")
= Worksheets().Range("D1")
= Worksheets().Range("E1")
= Worksheets().Range("f1")
1 = Worksheets().Range("g1")
= Worksheets().Range("H1")
ElseIf a < 0 Then
ComboBox1.ListIndex = a + 1
Windows("" & Year(Date)).Activate
= (Worksheets().Range("C" & (ComboBox1.ListIndex + 1)))
= (Worksheets().Range("B" & (ComboBox1.ListIndex + 1)))
= (Worksheets().Range("A" & (ComboBox1.ListIndex + 1)))
= (Worksheets().Range("D" & (ComboBox1.ListIndex + 1)))
= (Worksheets().Range("E" & (ComboBox1.ListIndex + 1)))
= Worksheets().Range("f" & (ComboBox1.ListIndex + 1))
1 = Worksheets().Range("g" & (ComboBox1.ListIndex + 1))
= Worksheets().Range("H" & (ComboBox1.ListIndex + 1))
Else
Windows("" & Year(Date)).Activate
= (Worksheets().Range("C" & (ComboBox1.ListIndex + 1)))
= (Worksheets().Range("B" & (ComboBox1.ListIndex + 1)))
= (Worksheets().Range("A" & (ComboBox1.ListIndex + 1)))
= (Worksheets().Range("D" & (ComboBox1.ListIndex + 1)))
= (Worksheets().Range("E" & (ComboBox1.ListIndex + 1)))
= Worksheets().Range("f" & (ComboBox1.ListIndex + 1))
1 = Worksheets().Range("g" & (ComboBox1.ListIndex + 1))
= Worksheets().Range("H" & (ComboBox1.ListIndex + 1))
End If
End Sub



Private Sub _Click()
Windows("" & Year(Date)).Activate
ActiveWorkbook.Save
ActiveWindow.Close
Windows("" & Year(Date)).Activate
ActiveWorkbook.Save
ActiveWindow.Close
Windows(".xls").Activate
ActiveWorkbook.Save
ActiveWindow.Close
Application.Quit
ActiveWorkbook.RunAutoMacros Which:=xlAutoClose
End Sub



Private Sub UserForm_Activate()
Windows(".xls").Activate
= " : " & Worksheets("1").Range("E7") & _
" : " & Worksheets("1").Range("C7") & _
" P/c : " & Worksheets("1").Range("Q8") & _
" : " & Worksheets("1").Range("D8") & _
" : " & Worksheets("1").Range("P9")
= Worksheets("1").Range("A1")
Windows("" & Year(Date)).Activate
ComboBox1.Clear
= True
X = 1
= Year(Date)
While Len(Worksheets().Range("A" & X)) <> 0
ComboBox1.AddItem (Worksheets().Range("A" & X))
X = X + 1
Wend
End Sub

Private Sub _Click()
If Dir("C:Program Files" & (Year(Date) - 1) & ".xls") = _
"" & (Year(Date) - 1) & ".xls" Then
Workbooks.Open FileName:="C:Program Files" & (Year(Date) - 1)
Windows("" & (Year(Date) - 1)).Activate
Worksheets().Select
= Year(Date) - 1
Else
= MsgBox(" ", , BOX)
Exit Sub
End If
= True

End Sub

Private Sub _Click()
UserForm1.Hide
UserForm3.Show
End Sub

Private Sub _Click()
UserForm1.Hide
UserForm2.Show
End Sub

Private Sub _Click() 1
If IsDate() = True Then
= CDate() - 1
Else
End If
End Sub

Private Sub _Click()
If IsDate() = True Then
= CDate() + 1
Else
End If
End Sub

Private Sub _Click() Excel
Windows(".xls").Activate
Application.Visible = True
UserForm1.Hide
ActiveWindow.SelectedSheets.PrintPreview
Application.Visible = False
UserForm1.Show
End Sub

Private Sub UserForm_Initialize()
If Dir("C:Program Files" & Year(Date) & ".xls") <> _
"" & Year(Date) & ".xls" Then





Workbooks.Open FileName:="C:Program Files" & (Year(Date) - 1)
Windows("" & (Year(Date) - 1)).Activate
ActiveWorkbook.SaveAs FileName:="C:Program Files" & Year(Date)
Workbooks.Open FileName:="C:Program Files" & (Year(Date) - 1)
Windows("" & (Year(Date) - 1)).Activate
ActiveWorkbook.SaveAs FileName:="C:Program Files" & Year(Date)

Workbooks.Open FileName:="C:Program Files.xls"
Windows(".xls").Activate
X = 1
Do While Len(Worksheets("1").Range("A" & X)) <> 0
X = X + 1
Loop
X = X - 1

Do While X <> 0
Windows("" & Year(Date)).Activate
Worksheets(CStr(X)).Select
Worksheets(CStr(X)).Range("L1:L65535").Select
Selection.ClearContents

Windows("" & Year(Date)).Activate
Worksheets(CStr(X)).Select
Worksheets(CStr(X)).Columns("A:AG").Select
Selection.ClearContents
X = X - 1
Loop
Windows("" & Year(Date)).Activate
ActiveWorkbook.Save
Windows("" & Year(Date)).Activate
ActiveWorkbook.Save
Workbooks.Open FileName:="C:Program Files.xls"
Windows(".xls").Activate
Worksheets("").Select
X = 1
While Len(Worksheets("").Range("A" & X)) <> 0
X = X + 1
Wend
Worksheets("").Range("A" & X) = CStr((Year(Date) - 1))
Worksheets("").Range("A" & X) = CStr(Year(Date))
ActiveWorkbook.Save
Else
Workbooks.Open FileName:="C:Program Files" & Year(Date)
Workbooks.Open FileName:="C:Program Files" & Year(Date)
Workbooks.Open FileName:="C:Program Files.xls"
Workbooks.Open FileName:="C:Program Files.xls"
End If


= Year(Date)
2.List = Array(1, 2, 3)
2 = 1
= Date
= True
ComboBox1.Visible = True
.Visible = False
Label1.Visible = True
.Visible = False
Label14.Visible = False
.Visible = False
.Visible = False
.Visible = False
2.Visible = False
.Visible = False
.Visible = False
.Visible = False
.Visible = False
.Visible = False
.Caption = " : " & Date
BOX = ""
Windows(".xls").Activate
= Worksheets("1").Range("a1")
Windows("" & Year(Date)).Activate
X = 1
While Len(Worksheets().Range("A" & X)) <> 0
ComboBox1.AddItem (Worksheets().Range("A" & X))
X = X + 1
Wend
End Sub

Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
Windows("" & Year(Date)).Activate
ActiveWorkbook.Save
ActiveWindow.Close
Windows("" & Year(Date)).Activate
ActiveWorkbook.Save
ActiveWindow.Close
Windows(".xls").Activate
ActiveWorkbook.Save
ActiveWindow.Close
Application.Quit
ActiveWorkbook.RunAutoMacros Which:=xlAutoClose
End Sub


Private Sub _Click()
Windows("" & Year(Date)).Activate
If = False Then
Exit Sub
Else
End If
X = 1
Do While X < ComboBox1.ListCount + 1
If = Worksheets().Range("A" & X) _
And = Worksheets().Range("b" & X) _
And = Worksheets().Range("c" & X) _
And = Worksheets().Range("d" & X) _
And = Worksheets().Range("e" & X) _
And = Worksheets().Range("f" & X) _
And = Worksheets().Range("H" & X) _
And 1 = Worksheets().Range("g" & ComboBox1.ListIndex + 1) _
Then
= MsgBox(" : " & & " ." _
& Chr(10) & " .", , BOX)
Exit Sub
Else
X = X + 1
End If
Loop

Worksheets().Range("A" & (ComboBox1.ListIndex + 1)) =
Worksheets().Range("b" & (ComboBox1.ListIndex + 1)) =
Worksheets().Range("c" & (ComboBox1.ListIndex + 1)) =
Worksheets().Range("d" & (ComboBox1.ListIndex + 1)) =
Worksheets().Range("e" & (ComboBox1.ListIndex + 1)) =
Worksheets().Range("f" & (ComboBox1.ListIndex + 1)) =
Worksheets().Range("g" & (ComboBox1.ListIndex + 1)) = 1
Worksheets().Range("H" & (ComboBox1.ListIndex + 1)) =
ActiveWorkbook.Save
= MsgBox(" : " & & " ", , BOX)
.SetFocus
End Sub
Private Sub _Click()
Windows("" & Year(Date)).Activate
If = False Then
Exit Sub
Else
End If
X = 1
Do While X < ComboBox1.ListCount + 1
If = Worksheets().Range("A" & X) _





And = Worksheets().Range("b" & X) _
And = Worksheets().Range("c" & X) _
And = Worksheets().Range("d" & X) _
And = Worksheets().Range("e" & X) _
And = Worksheets().Range("f" & X) _
And = Worksheets().Range("H" & X) _
Then
= MsgBox(" : " & & " ." _
& Chr(10) & " .", , BOX)
Exit Sub
Else
X = X + 1
End If
Loop

X = 1
While Len(Worksheets().Range("A" & X)) <> 0
X = X + 1
Wend
Worksheets().Range("A" & X) =
Worksheets().Range("b" & X) =
Worksheets().Range("c" & X) =
Worksheets().Range("d" & X) =
Worksheets().Range("e" & X) =
Worksheets().Range("f" & X) =
Worksheets().Range("g" & X) = 1
Worksheets().Range("H" & X) =
ComboBox1.Visible = True
ComboBox1.AddItem (Worksheets().Range("A" & (ComboBox1.ListCount + 1)))
ComboBox1.ListIndex =
.