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

[µo°Ý] Âà¸m§xÂZ

[µo°Ý] Âà¸m§xÂZ

§Ú¦b¤U¦CVBA¤º¤@ª½³QA©Ò§xÂZ, ¦Ó¥B

a = Application.match(Sheets("201507").Range("A" & i), Sheets("data").Range("D:D"), 0) ->¤@ª½¥X²{°ÝÃD

Set rangeFilledWithTransposedData = Sheets("201507").Range("e3:e31") ->¤£ª¾¦p¦ó¥i¥HÅܦ¨ÅܼÆ, ¹ïÀ³201507ªºID.



Sub match()

Dim i As Integer
Dim a As Integer
Dim transposedVariant As Variant
Dim sourceRowRange As Range
Dim sourceRowRangeVariant As Variant
Dim finalrow As Integer


Sheets("201507").Activate
Sheets("201507").Range("e:e").Select
Selection.ClearContents

finalrow = Cells(Rows.Count, 1).End(xlUp).Row

For i = 3 To finalrow

   a = Application.match(Sheets("201507").Range("A" & i), Sheets("data").Range("D:D"), 0)

    Set sourceRowRange = Sheets("data").Range("H" & a & ":AL" & a)
    sourceRowRangeVariant = sourceRowRange.Value
    transposedVariant = Application.Transpose(sourceRowRangeVariant)

    Dim rangeFilledWithTransposedData As Range
    Set rangeFilledWithTransposedData = Sheets("201507").Range("e3:e31")
    rangeFilledWithTransposedData.Value = transposedVariant
   
Next i

i = i + 1


End Sub
[/code]

        ÀR«ä¦Û¦b : ¡i¬O§_µo´§¤F¨}¯à¡H¡j¤H¶¡¹Ø©R¦]¬°µu¼È¡A¤~§óÅã±o¬Ã¶Q¡CÃø±o¨Ó¤@½ë¤H¶¡¡AÀ³°Ý¬O§_¬°¤H¶¡µo´§¤F¦Û¤vªº¨}¯à¡A¦Ó¤£­n¤@¨ý¨Dªø¹Ø¡C
ªð¦^¦Cªí ¤W¤@¥DÃD