'存檔
Private Sub Command1_Click()
Dim Str As String
Str = "輸入想存的字吧"
Open "C:\temp.txt" For Output As #1
'存檔
Private Sub Command1_Click()
Dim Str As String
Str = "輸入想存的字吧"
Open "C:\temp.txt" For Output As #1
If IsNumeric(Text1.Text) Then
Print "是數字"
Else
Print "不是數字"
End If
'產生100個亂數介於1-6之間
'計算出1-6出現次數,並且次數全部加總要100次
Private Sub Form_Activate()
Randomize
Dim count(6) As Integer '記錄筆數
Text1.SelStart = 0
Text1.SelLength = Len(Text1.Text)
Private Sub Command1_Click()
FileName = App.Path & "\test.xls"
If Dir(FileName) <> "" Then Kill FileName
Dim myExcel As Object
Set myExcel = CreateObject("excel.application")