|
こんにちは
べた書きですがお試しを
「シート1=Sheet1/シート2=Sheet2/シート3=Sheet3」としています。
Sub test()
Dim Sh_1 As Worksheet, Sh_2 As Worksheet, i As Long, ii As Long
Dim Ro As Long, Ro_1 As Long, Co As Long, Con As Currency
Set Sh_1 = Worksheets("Sheet1"): Set Sh_2 = Worksheets("Sheet2")
Ro_1 = Sh_1.Range("B1").End(xlToRight).Column
With Worksheets("Sheet3")
Ro = .Range("A65536").End(xlUp).Row
For i = 2 To .Range("B1").End(xlToRight).Column
For ii = 2 To Ro
Con = 0
For Co = 2 To Ro_1
Con = Con + Sh_1.Cells(i, Co).Value * Sh_2.Cells(ii, Co).Value
Next Co
.Cells(ii, i).Value = Val(Con)
Next ii
Next i
End With
Set Sh_1 = Nothing: Set Sh_2 = Nothing
End Sub
|
|