- ©«¤l
- 135
- ¥DÃD
- 19
- ºëµØ
- 0
- ¿n¤À
- 165
- ÂI¦W
- 0
- §@·~¨t²Î
- XP
- ³nÅ骩¥»
- 2003
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- ¨Ó¦Û
- »´ä
- µù¥U®É¶¡
- 2010-12-9
- ³Ì«áµn¿ý
- 2012-8-27
|
¼Ó¥D1¼Ó- Sub abc()
- Dim head(), body(), tail(), mycell As Range, i As Integer, j As Integer, k As Integer
- For Each mycell In Range([c2], [c65536].End(xlUp))
- ReDim Preserve head(i)
- ReDim Preserve body(i)
- ReDim Preserve tail(i)
- head(i) = Split(mycell, "-")(0)
- body(i) = Split(mycell, "-")(1)
- tail(i) = Split(mycell, "-")(2)
- i = i + 1
- Next
- Range("h2").Activate
- For j = 0 To UBound(head)
- For k = body(j) To tail(j)
- ActiveCell.Value = head(j) & "-" & k
- ActiveCell.Offset(1).Activate
- Next
- Next
- End Sub
½Æ»s¥N½X ¼Ó¥D5¼Ó- Sub myprint()
- Dim mycell As Range, head(), body(), tail(), BPnumber(), i As Integer
- Dim j As Integer, bp As Integer, k As Integer, l As Integer
- For Each mycell In Range([d2], [d65536].End(xlUp))
- ReDim Preserve head(i)
- ReDim Preserve body(i)
- ReDim Preserve tail(i)
- ReDim Preserve BPnumber(i)
- head(i) = Split(mycell, "-")(0)
- body(i) = Split(mycell, "-")(1)
- If UBound(Split(mycell, "-")) = 2 Then
- tail(i) = Split(mycell, "-")(2)
- Else
- tail(i) = ""
- End If
- BPnumber(i) = mycell.Offset(, 1).Value
- i = i + 1
- Next
- Range("L2").Activate
- For j = 0 To UBound(head)
- If tail(j) = "" Then
- If BPnumber(j) = 1 Then
- ActiveCell = Cells(j + 2, 2).Value
- ActiveCell.Offset(, 1) = Cells(j + 2, 2).Offset(, 1).Value
- ActiveCell.Offset(, 2) = head(j) & "-" & body(j)
- ActiveCell.Offset(1).Activate
- Else
- For bp = 1 To BPnumber(j)
- ActiveCell = Cells(j + 2, 2).Value
- ActiveCell.Offset(, 1) = Cells(j + 2, 2).Offset(, 1).Value
- ActiveCell.Offset(, 2) = head(j) & "-" & body(j) & Chr(64 + bp)
- ActiveCell.Offset(1).Activate
- Next
- End If
- Else
- If BPnumber(j) = 1 Then
- For k = body(j) To tail(j)
- ActiveCell = Cells(j + 2, 2).Value
- ActiveCell.Offset(, 1) = Cells(j + 2, 2).Offset(, 1).Value
- ActiveCell.Offset(, 2) = head(j) & "-" & k
- ActiveCell.Offset(1).Activate
- Next
- Else
- For k = body(j) To tail(j)
- For bp = 1 To BPnumber(j)
- ActiveCell = Cells(j + 2, 2).Value
- ActiveCell.Offset(, 1) = Cells(j + 2, 2).Offset(, 1).Value
- ActiveCell.Offset(, 2) = head(j) & "-" & k & Chr(64 + bp)
- ActiveCell.Offset(1).Activate
- Next
- Next
- End If
- End If
- Next
- End Sub
½Æ»s¥N½X ¤gªk¤j·Ò¿û,¤ñ¸ûÁc½Æ©MºC¤@ÂI
¥t¥~5¼ÓªþÀÉD7¤@Äæ,³Ì¥k¤â±¦³¦h¾lªÅ®æ,·|¼vÅTµ²ªG,n¤p¤ß³B²z |
|