thienhalata
Thành viên mới
- Tham gia
- 30/10/08
- Bài viết
- 10
- Được thích
- 1
Muốn gộp tất cả các công thức ma trận vào làm một View attachment Bang ma tran.xls
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, [c8]) Is Nothing Then
Const Hai As Byte = 2
[e6] = 1: [E7] = 0: [e8] = 0
[e9] = -1: [E10] = 0: [e11] = 0
[H6] = -1: [H7] = 0: [H8] = 0
[H9] = 1: [H10] = 0: [H11] = 0
[F6] = 0: [G6] = 0: [I6] = 0: [J6] = 0
[F9] = 0: [G9] = 0: [I9] = 0: [J9] = 0
Select Case Target.Value
Case 1
1 [f7] = 12: [i7] = -12: [f10] = -12: [i10] = 12
[g7].FormulaR1C1 = "=6*R[-3]C[-3]"
3 [j7].FormulaR1C1 = "=6*R[-3]C[-6]"
[F8].FormulaR1C1 = "=6*R[-4]C[-2]"
5 [G8].FormulaR1C1 = "=4*R[-4]C[-3]^2"
[I8].FormulaR1C1 = "=-6*R[-4]C[-5]"
7 [j8].FormulaR1C1 = "=2*R[-4]C[-6]^2"
[g10].FormulaR1C1 = "=6*R[-5]C[-3]"
9 [J10].FormulaR1C1 = "=6*R[-5]C[-6]"
[F11].FormulaR1C1 = "=6*R[-6]C[-2]"
11 [G11].FormulaR1C1 = "=2*R[-6]C[-3]"
[i11].FormulaR1C1 = "=6*R[-6]C[-5]"
13 [J11].FormulaR1C1 = "=4*R[-6]C[-6]^2"
Case 2
Case 3
Case 4
End Select
End If
End Sub
Case 1
1 [f7] = 12: [i7] = -12: [f10] = -12: [i10] = 12
[g7].FormulaR1C1 = "=6*R[-3]C[-3]"
3 [j7].FormulaR1C1 = "=6*R[-3]C[-6]"
[F8].FormulaR1C1 = "=6*R[-4]C[-2]"
5 [G8].FormulaR1C1 = "=4*R[-4]C[-3]^2"
[I8].FormulaR1C1 = "=-6*R[-4]C[-5]"
7 [j8].FormulaR1C1 = "=2*R[-4]C[-6]^2"
[g10].FormulaR1C1 = "=6*R[-5]C[-3]"
9 [J10].FormulaR1C1 = "=6*R[-5]C[-6]"
[F11].FormulaR1C1 = "=6*R[-6]C[-2]"
11 [G11].FormulaR1C1 = "=2*R[-6]C[-3]"
[i11].FormulaR1C1 = "=6*R[-6]C[-5]"
13 [J11].FormulaR1C1 = "=4*R[-6]C[-6]^2"
Case 2