.


:




:

































 

 

 

 


Sub CommandButton1_Click()




Dim a, b, c As Single

a = CSng(TextBox1.Text)

b = CSng(TextBox2.Text)

If CheckBox1.Value = True Then

c = a + b

UserForm1.Label4 = c

End If

If CheckBox2.Value = True Then

c = a * b

UserForm1.Label4 = c

End If

If (CheckBox1.Value = False) And (CheckBox2.Value = False) Then

UserForm1.Label4 = ". "

End If

End Sub


 


29 Visual Basic for Application Microsoft Office Word.

Document.

Activate() (, ).

Close() . ( ), ( ).

Save() . , Save As.

SaveAs() . , , , , . , , .

Select() . , Selection Range.

Select.

Calculate() ( Single).

ClearFormatting() ( , ). Selection, Find Replace.

Collapse() . : . , .

Copy(), CopyAsPicture(), Cut(), Paste() Delete() , , .

1()

Range("A1").Select

ActiveCell = ""

n = InputBox(" ")

Range("B1").Select

ActiveCell = n

Range("C1").Select

ActiveCell = ""

Range("A2").Select

ActiveCell = ""

Range("B2").Select

ActiveCell = ""

n1 = InputBox(" ")

Range("A3").Select

ActiveCell = n1

Range("B3").Select

ActiveCell.Formula = "=$b$1*a3"

End Sub

 



30 Visual Basic for Application Microsoft Office Word.

 

Find Replacement, , . Find , "" . (Text, Style, Font, Forward, MathCase, LanguageID ..), . , Execute() , ( ReplaceWith, ). , , , Execute(). ( ), true, false.

Find, , . Find Selection, . Range, . , "2004", :

Selection.Find.Text = "2004"

Selection.Find.Execute

Replacement . , "2004" "2005",

Selection.Find.Text = "2004"

Selection.Find.Replacement.Text = "2005"

Selection.Find.Execute Replace:= wdReplaceAll

, - ClearFormatting(). Find ( ) . , :

Selection.Find.Text = "2004"





:


: 2016-12-06; !; : 433 |


:

:

, ; , .
==> ...

1826 - | 1592 -


© 2015-2024 lektsii.org - -

: 0.012 .