1.ActiveSheet
2.FullName ,
3.Name
4.Saved , ( False, )
Worksheet
1.Name
2.OnSheetActivate ,
3.Previous
4.ProtectContents
5.Visible ( )
: , ( ). , , , (=) : . =
, , :
1. . , : ActiveCell.Font.Size = 14
2. . . : ActiveCell.Font.Name = "Courier New Cyr"
3. . , VBA True False, , . ( ): ActiveCell.Font.Italic = True
Sub pr()
Dim s, s1, s2, s3, s4, s5, s6, s7, s8 As String
Dim n, i, n1 As Integer
s = InputBox(" ")
s1 = InputBox(" ")
n = 0
n1 = Len(s)
For i = 1 To n1 Step 1
s2 = Mid(s, i, 1)
If s2 = s1 Then
n = n + 1
End If
Next i
MsgBox n
End Sub
25 Visual Basic for Application Microsoft Office Excel.
(Properties), (Methods). , , . , Worksheet Calculate.
. , - . , , , , , , .
, : .
|
|
, : ActiveWorkbook.Save
, , . .(1, 2,...) . 1, 2,...
, Range Offset, , . : .Offset(rowOffset,columnOffset)
rowOffset columnOffset . , , : ActiveCell.Offset(0,1).Value
Offset Range, Value .
, VBA , , . , : ActiveCell.Offset(columnOffset:=1).Value
, :=, .
Sub pr()
Dim str, str1 As String
Dim n, n1, n2 As Integer
Open "C:\1.txt" For Input As #1
Input #1, str
Close #1
n = Val(str)
Open "C:\2.txt" For Input As #2
Input #2, str1
Close #2
n1 = Val(str1)
n2 = n1 + n
Open "C:\3.txt" For Output As #3
Write #3, n2
Close #3
End Sub
26 Workbook Workbooks.
Activate , .Workbook. Activate
Add Workbooks.
Add (Template)Template , . : xlWBATChart, xlWBATExce14IntlMacroSheet, xlWBATExce14MacroSheet xlWBATWorksheet.
Template , , SheetsInNew Workbook
Protect .Protect (Password, Structure, Windows)
Password ,
Structure True ( , . . ) False ( )
windows True ( ) False ( )
: ActiveWorkbook. Protect Password:=
Unprotect Unprotect (Password)Password ,
: ActiveWorkbook. Unprotect Password: =
Close
Open
OpenText ,
Save
SaveAs .SaveAs (Filename)Filename , ,
|
|
: ActiveBook. SaveAs Filename: =
SaveAsCopy , .SaveAs (Filename, FileFormat)
Filename , ,
: ActiveBook. SaveAsCopy Filename: =
PrintPreview
Printout