III 7 VBA / III 7 (2014 11 18 )
Excel Excel Excel 20132 20 = 1048576 Excel 201316 100 III 7 (2014 11 18 ) 1
Excel VBA Excel Excel 2 20 Excel QR Excel R QR QR BLASLAPACK III 7 (2014 11 18 ) 2
VBA VBA (Visual Basic for Applications) Visual Basic VBAVisual Basic Visual BasicC III 7 (2014 11 18 ) 3
VBA 6-1b.xlsx 2 Excel.xlsm 01 Sub test() 02 Dim tmp As Double 03 tmp = Worksheets("Sheet1").Range("C4").Value 04 tmp = tmp * tmp 05 Range("E4").Value = tmp 06 Range("F4").Value = "=POWER(C4,2)" 07 MsgBox(": =" + CStr(tmp)) 08 End Sub test III 7 (2014 11 18 ) 4
VBA 0108Subtest 1test 02 Double tmp Dim As Doubletmp Dim As As III 7 (2014 11 18 ) 5
VBA 03Sheet1C4tmp = "" 04tmp2tmp 05E4tmpE4 III 7 (2014 11 18 ) 6
VBA 06 F4 "=POWER(C4,2)" 07 ": =" + CStr(tmp) +"AB"+"CD""ABCD" CStr() III 7 (2014 11 18 ) 7
VBA VBA 02 Dim tmp As Double 02 dim tmp as double "a" "A" III 7 (2014 11 18 ) 8
VBA : Integer : 2 15 2 15 Long : 2 31 2 31 Currency : 2 63 2 63 Single : 106 Double : 1015 String : Boolean : TrueFalse Variant : III 7 (2014 11 18 ) 9
VBA : + : 3+47 - : 3-4-1 * : 3*412 / : 3/41 \ (or ) : 3\40 Mod : 8 Mod 32 ^ : 3^23 2 9 () III 7 (2014 11 18 ) 10
VBA () IfElseIfElseEnd If 01 If A Then 02 A 03 ElseIf B Then 04 AB 05 ElseIf C Then 06 A, BC 07 Else 08 A, B, C 09 End If ElseIf0Else III 7 (2014 11 18 ) 11
VBA () A = B : ABTrue= A < B : ABTrue A > B : ABTrue A <= B : ABTrue A >= B : ABTrue A <> B : ABTrue A And B : ABTrueTrue A Or B : ABTrue True Not A : ATrueTrue III 7 (2014 11 18 ) 12
VBA (For) ForForNext 01 For = To Step 02 03 Next Step 1 III 7 (2014 11 18 ) 13
VBA (For) 01 Dim i As Integer 02 For i = 3 To 10 Step 2 03 (i=3, 5, 7, 94) 04 Next 01 Dim i As Integer 02 For i = 1 To 5 03 (i=1, 2, 3, 4, 55) 04 Next 01 Dim i As Integer 02 For i = 10 To 3 Step -3 03 (i=10, 7, 43) 04 Next III 7 (2014 11 18 ) 14
VBA (For) ForExit For 01 Dim i As Integer 02 For i = 3 To 10 Step 2 03 If i = 7 Then 04 Exit For i=7for 05 End If 06 (i=3, 52) 07 Next III 7 (2014 11 18 ) 15
VBA (Do) DoLoopExit Do 01 Dim i As Integer 02 i = 1 03 Do 04 (i=1, 2, 3, 44) 05 i = i + 1 06 If i = 5 Then 07 Eixt Do 08 End If 09 Loop III 7 (2014 11 18 ) 16
VBA (Do, While) DoLoop While 01 Dim i As Integer 02 i = 1 03 Do While i < 5 04 (i=1, 2, 3, 44) 05 i = i + 1 06 Loop 01 Dim i As Integer 02 i = 10 03 Do While i < 5 04 (1) 05 i = i + 1 06 Loop III 7 (2014 11 18 ) 17
VBA CInt : Integer CLng : Long CSng : Single CDbl : Double CStr : String III 7 (2014 11 18 ) 18
VBA 1 Dim () As (0)(1)...()+1 01 Dim i As Integer 02 Dim arr(5) As Integer 03 For i = 0 To 5 04 arr(i) = i * i 05 Next arr(0) 0 arr(3) 9 arr(5) 25 III 7 (2014 11 18 ) 19
VBA 01 Dim i As Integer 02 Dim arr(5) As Integer 01 Dim i As Integer, arr(5) As Integer 01 Dim i, arr(5) As Integer ivariant III 7 (2014 11 18 ) 20
VBA Worksheets("Sheet1").Range("C4").Value Worksheets("Sheet1").Cells(4,3).Value C4Worksheets("Sheet1"). III 7 (2014 11 18 ) 21
VBA Range Range("D2:E4").Value Range(Cells(2, 4), Cells(4, 5)).Value Range(Cells(2, 4), Cells(4, 5)).Value = 1.5 1.5 III 7 (2014 11 18 ) 22
VBA Cells(3, 2).Interior.Color = RGB(255, 0, 0) 32RGB0255 Cells(3, 2).RowHeight = 100 Cells(3, 2).ColumnWidth = 100 31002100 III 7 (2014 11 18 ) 23
Excel Calls(2,1).Value = "=POWER(A1,2)" x = Calls(2,1).Value "=POWER(A1,2)"A12 x = Application.Power(Cells(1,1),2) x = Application.Power(4,2) x16 III 7 (2014 11 18 ) 24
VBA (SubFunction) Sub A B QR QR 2 QR A B 2 III 7 (2014 11 18 ) 25
VBA Sub FunctionSub 01 Sub Kaku(n As Long) 02 Dim i As Long 03 For i = 1 To n 04 Cells(i, 1) = 0 05 Next 06 End Sub Call Kaku(5) Kaku 5 150 III 7 (2014 11 18 ) 26
VBA 01 Function MySum(n As Long) 02 Dim i As Long, s As Long 03 s = 0 04 For i = 1 To n 05 s = s + i 06 Next 07 MySum = s 08 End Function n = MySum(5)n1+2+3+ 4 + 515 III 7 (2014 11 18 ) 27
VBA III 7 (2014 11 18 ) 28
VBA 6-1b.xlsx 22 III 7 (2014 11 18 ) 29
VBA Longi, male, female IntegersexDoubleheight, weight i2male, female0 Do, Loop11 III 7 (2014 11 18 ) 30
VBA iexit Do isex, height, weight sex-1male1 5male6male sex1female1 8female9female i1 5689 III 7 (2014 11 18 ) 31
VBA 01 Sub Kadai() 02 Dim i As Long, male As Long, female As Long 03 Dim sex As Integer 04 Dim height As Double, weight As Double 05 i = 2 2 06 male = 0 07 female = 0 08 Do 09 If Cells(i, 1) = "" Then 10 Exit Do 11 End If 12 sex = Cells(i, 1).Value 13 height = Cells(i, 2).Value 14 weight = Cells(i, 3).Value III 7 (2014 11 18 ) 32
VBA 15 If sex = -1 Then 16 male = male + 1 17 Cells(male, 5) = height 18 Cells(male, 6) = weight 19 Else 20 female = female + 1 21 Cells(female, 8) = height 22 Cells(female, 9) = weight 23 End If 24 i = i+1 25 Loop 26 End Sub III 7 (2014 11 18 ) 33
VBA VBA 23 234 III 7 (2014 11 18 ) 34