- ©«¤l
- 1447
- ¥DÃD
- 40
- ºëµØ
- 0
- ¿n¤À
- 1471
- ÂI¦W
- 0
- §@·~¨t²Î
- Windows 7
- ³nÅ骩¥»
- Excel 2010 & 2016
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW
- µù¥U®É¶¡
- 2020-7-15
- ³Ì«áµn¿ý
- 2024-12-5
|
¦^´_ 1# coafort
ÁÂÁ«e½úµoªí¦¹¥DÃD»P½d¨Ò
«á¾ÇÂǦ¹©«½m²ßVBA°}¦C»y¦r¨å,¾Ç²ß¤è®×¦p¤U,½Ð«e½ú°Ñ¦Ò
°õ¦æ«e:
°õ¦æµ²ªG:
Option Explicit
Sub TEST()
Dim Brr, Crr, Y, R&, C&, i&, T$, V$, Z$, Q$
Dim xR1 As Range, xR2 As Range, Sh1 As Worksheet, Sh2 As Worksheet
Set Y = CreateObject("Scripting.Dictionary")
Set Sh1 = Sheets("¤u§@ªí1"): Set Sh2 = Sheets("¤u§@ªí2")
Set xR1 = Sh1.UsedRange.Offset(1, 0): Brr = xR1
Set xR2 = Sh2.UsedRange.Offset(2, 0): Crr = xR2
For i = 1 To UBound(Brr)
If Brr(i, 1) = "" Then GoTo i01 Else T = Brr(i, 1) & "|" & Brr(i, 2)
Y(T & "/°t®§") = Brr(i, 3): Y(T & "/°tªÑ") = Brr(i, 5)
i01:
Next
For C = 1 To UBound(Crr, 2) Step 8
For R = 1 To UBound(Crr)
If Crr(R, C) = "" Then GoTo i02 Else T = Crr(R, C) & "|" & Crr(R, C + 1)
Crr(R, C + 4) = Y(T & "/°t®§"): Crr(R, C + 6) = Y(T & "/°tªÑ")
V = Replace(Cells(R + 2, C + 2).Address, "$", "")
Z = Replace(Cells(R + 2, C + 4).Address, "$", "")
Q = Replace(Cells(R + 2, C + 6).Address, "$", "")
Crr(R, C + 5) = "=IF(" & Z & "," & Z & "*" & V & ","""")"
Crr(R, C + 7) = "=IF(" & Q & "," & Q & "/10*" & V & ","""")"
Next
i02:
Next
xR2 = Crr
Set Y = Nothing: Set xR1 = Nothing: Set xR2 = Nothing: Erase Brr, Crr
Set Sh1 = Nothing: Set Sh2 = Nothing
End Sub
ÁÂÁ½׾Â,ÁÂÁ¦U¦ì«e½ú |
|