- ©«¤l
- 216
- ¥DÃD
- 71
- ºëµØ
- 0
- ¿n¤À
- 292
- ÂI¦W
- 0
- §@·~¨t²Î
- window xp
- ³nÅ骩¥»
- 2007
- ¾\ŪÅv
- 20
- ©Ê§O
- ¤k
- µù¥U®É¶¡
- 2012-6-27
- ³Ì«áµn¿ý
- 2024-9-28
|
§Ú¦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] |
|