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

[µo°Ý] Application.Transpose() ¥i¥H³B²z¸ê®ÆÂà¸mªº°}¦Cªø«× ?

¦^´_ 1# Scott090
½T¹êtranspose¦³°}¦C¤j¤p­­¨î¡A
¥i¥H¦Û¤v¼gÂà¸mªºFunction:
  1. Function MyTranspose(arInput)
  2.   Dim i As Long, j As Long
  3.   Dim arRetn
  4.   
  5.   If LBound(arInput) <> 1 Or LBound(arInput, 2) <> 1 Then Err.Raise vbObjectError + 9999, , "The low bound of input array should be 1."
  6.   
  7.   If UBound(arInput) <= 65536 And UBound(arInput, 2) <= 65536 Then
  8.     MyTranspose = Application.Transpose(arInput)
  9.   Else
  10.     If UBound(arInput, 2) = 1 Then
  11.       ReDim arRetn(1 To UBound(arInput))
  12.       For i = 1 To UBound(arInput)
  13.         arRetn(i) = arInput(i, 1)
  14.       Next
  15.     Else
  16.       ReDim arRetn(1 To UBound(arInput, 2), 1 To UBound(arInput))
  17.       For i = 1 To UBound(arInput)
  18.         For j = 1 To UBound(arInput, 2)
  19.           arRetn(j, i) = arInput(i, j)
  20.         Next
  21.       Next
  22.     End If
  23.     MyTranspose = arRetn
  24.   End If
  25. End Function
½Æ»s¥N½X
ªí¹F¤£²M¡BÃD·N¤£©ú½T¡B¨SªþÀɮ׮榡¡B¨S¦³°Q½×°ÝÃDªººA«×~~~~~~¥H¤W·R²ö¯à§U¡C

TOP

        ÀR«ä¦Û¦b : ¹D¼w¬O´£ª@¦Û§Úªº©ú¿O¡A¤£¸Ó¬O¨þ¥¸§O¤HªºÃ@¤l¡C
ªð¦^¦Cªí ¤W¤@¥DÃD