ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

­¼ªk¹Bºâ¡H

¦^´_ 1# q1a2z5
  1. Sub Test()
  2.   Dim sA As String, sB As String, sM As String, sRslt As String
  3.   Dim rngA, rngRslt As Range
  4.   
  5.   Set rngA = Range("J4:M4")   '½d³ò©Î¦ì¸m¥u­n§ï³o¸Ì´N¦n
  6.   
  7.   sA = Join(Application.Transpose(Application.Transpose(rngA.Value)), "")
  8.   sB = Join(Application.Transpose(Application.Transpose(rngA.Offset(1).Value)), "")
  9.   
  10.   '²M°£¤§«eªºµ²ªG
  11.   With rngA
  12.   With .Offset(2, -.Count).Resize(.Count + 1, 2 * .Count)
  13.     .ClearContents
  14.     .Borders(xlInsideHorizontal).LineStyle = xlContinuous
  15.     .Borders(xlInsideHorizontal).LineStyle = xlNone
  16.   End With
  17.   End With
  18.   
  19.   '­pºâ¹Lµ{
  20.   For i = 1 To Len(sB)
  21.     sM = CStr(CLng(Mid(sB, Len(sB) - i + 1, 1)) * CLng(sA))
  22.     With rngA.Resize(, rngA.Count + 1).Offset(1 + i, -i)
  23.       For j = 1 To Len(sM)
  24.         .Cells(.Count - j + 1).Value = Mid(sM, Len(sM) - j + 1, 1)
  25.       Next
  26.       If i = 1 Then .Borders(xlEdgeTop).LineStyle = xlContinuous
  27.     End With
  28.   Next
  29.   
  30.   '­pºâµ²ªG
  31.   sRslt = CStr(CLng(sA) * CLng(sB))
  32.   Set rngRslt = rngA.Offset(2 + Len(sB), -Len(sB)).Resize(, Len(sA) + Len(sB))
  33.   With rngRslt
  34.     .Borders(xlEdgeTop).LineStyle = xlContinuous
  35.     For i = 1 To Len(sRslt)
  36.       .Cells(.Count - i + 1).Value = Mid(sRslt, Len(sRslt) - i + 1, 1)
  37.     Next
  38.   End With
  39. End Sub
½Æ»s¥N½X

TOP

        ÀR«ä¦Û¦b : ¤Hªº²´·úªø¦b«e­±¡A¥u¬Ý¨ì§O¤Hªº¯ÊÂI¡Aµ·²@¬Ý¤£¨ì¦Û¤vªº¯ÊÂI¡C
ªð¦^¦Cªí ¤W¤@¥DÃD