- ©«¤l
- 1018
- ¥DÃD
- 15
- ºëµØ
- 0
- ¿n¤À
- 1058
- ÂI¦W
- 0
- §@·~¨t²Î
- win7 32bit
- ³nÅ骩¥»
- Office 2016 64-bit
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ®ç¶é
- µù¥U®É¶¡
- 2012-5-9
- ³Ì«áµn¿ý
- 2022-9-28
|
¦^´_ 1# q1a2z5 - Sub Test()
- Dim sA As String, sB As String, sM As String, sRslt As String
- Dim rngA, rngRslt As Range
-
- Set rngA = Range("J4:M4") '½d³ò©Î¦ì¸m¥un§ï³o¸Ì´N¦n
-
- sA = Join(Application.Transpose(Application.Transpose(rngA.Value)), "")
- sB = Join(Application.Transpose(Application.Transpose(rngA.Offset(1).Value)), "")
-
- '²M°£¤§«eªºµ²ªG
- With rngA
- With .Offset(2, -.Count).Resize(.Count + 1, 2 * .Count)
- .ClearContents
- .Borders(xlInsideHorizontal).LineStyle = xlContinuous
- .Borders(xlInsideHorizontal).LineStyle = xlNone
- End With
- End With
-
- 'pºâ¹Lµ{
- For i = 1 To Len(sB)
- sM = CStr(CLng(Mid(sB, Len(sB) - i + 1, 1)) * CLng(sA))
- With rngA.Resize(, rngA.Count + 1).Offset(1 + i, -i)
- For j = 1 To Len(sM)
- .Cells(.Count - j + 1).Value = Mid(sM, Len(sM) - j + 1, 1)
- Next
- If i = 1 Then .Borders(xlEdgeTop).LineStyle = xlContinuous
- End With
- Next
-
- 'pºâµ²ªG
- sRslt = CStr(CLng(sA) * CLng(sB))
- Set rngRslt = rngA.Offset(2 + Len(sB), -Len(sB)).Resize(, Len(sA) + Len(sB))
- With rngRslt
- .Borders(xlEdgeTop).LineStyle = xlContinuous
- For i = 1 To Len(sRslt)
- .Cells(.Count - i + 1).Value = Mid(sRslt, Len(sRslt) - i + 1, 1)
- Next
- End With
- End Sub
½Æ»s¥N½X |
|