- ©«¤l
- 835
- ¥DÃD
- 6
- ºëµØ
- 0
- ¿n¤À
- 915
- ÂI¦W
- 13
- §@·~¨t²Î
- Win 10,7
- ³nÅ骩¥»
- 2019,2013,2003
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2010-5-3
- ³Ì«áµn¿ý
- 2024-10-25
|
Dear¤j¤j:
°ÝÃD¡A¦p¦ó°Ñ¦Ò¤u§@ªí1¡A§¹¦¨¤u§@ªí2 ªºtable¡C
¥Ø«e·Q¨ì¥Î¸ê®ÆåªR¡A¦ý¤£ª¾¦p¦ó§Ë?
...
jj369963 µoªí©ó 2014-9-4 17:06 - Sub nn()
- Dim iCol%, iNum%, iSB%, iSE%, iTB%, iTE%
- Dim lSRow&, lTRow&
- Dim sStr1$, sStr2$, sStr$
- Dim vD
- Dim wsSou As Worksheet, wsTar As Worksheet
-
- Set vD = CreateObject("Scripting.Dictionary")
- Set wsSou = Sheets("¤u§@ªí1")
- Set wsTar = Sheets("¤u§@ªí2")
- lSRow = 1
- lTRow = 2
- iCol = 2
- With wsTar
- While .Cells(1, iCol) <> ""
- vD(CStr(.Cells(1, iCol))) = iCol
- iCol = iCol + 1
- Wend
- With wsSou
- While .Cells(lSRow, 1) <> ""
- wsTar.Cells(lTRow, 1) = .Cells(lSRow, 1)
- sStr1 = .Cells(lSRow, 2)
- sStr2 = .Cells(lSRow, 3)
-
- iSB = InStr(1, sStr1, "#") + 1
- iTB = InStr(1, sStr2, "#") + 1
- While iSB < Len(sStr1)
- iSE = InStr(iSB, sStr1, "#")
- If iSE = 0 Then iSE = Len(sStr1) + 1
- iTE = InStr(iTB, sStr2, "#")
- If iTE = 0 Then iTE = Len(sStr2) + 1
- wsTar.Cells(lTRow, vD(CStr(Application.Proper(Mid(sStr1, iSB, iSE - iSB))))) = Mid(sStr2, iTB, iTE - iTB)
- iSB = iSE + 1
- iTB = iTE + 1
- Wend
- lSRow = lSRow + 1
- lTRow = lTRow + 1
- Wend
- End With
- End With
- End Sub
½Æ»s¥N½X |
|