Advertisement
Advertisement
| 04.16.2008 at 01:39PM PDT, ID: 23328824 |
|
[x]
Attachment Details
|
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: |
Sub test()
Dim aSources() As String
Dim aDestinations() As String
Dim iSource, iDestination As Integer
aSources = Split("H6,H7,H8,H9,H10,H11", ",")
aDestinations = Split("C20,C21,C22,", ",")
iDestination = LBound(aDestinations)
For iSource = LBound(aSources) To UBound(aSources)
If Sheets(2).Range(aSources(iSource)).Value <> 0 Then
Sheets(4).Range(aDestinations(iDestination)).Value = Sheets(2).Range(aSources(iSource)).Value
iDestination = 1 + iDestination
End If
Next iSource
While iDestination <= UBound(aDestinations)
Sheets(4).Range(aDestinations(iDestination)).Value = ""
iDestination = 1 + iDestination
Wend
End Sub
|