On 8 Mai, 20:21, joel <j...@discussions.microsoft.com> wrote:
> Your request asked for multiple worksheets So I had to do the following
I GET IT !!
I worked with your code , but forever highlighting the next part :
after:=.Sheets(.Sheet.Count) , the word ,,Sheet,, from
(.Sheet.Count) .
(I tried and with ,,Sheets" ... )
So , why I needed to put the result in entire Column , was to check
then
the data , but , now , I inserted a UDF function which show me
the result I need ; with Transpose method , I could still keep my
old code , and the code copy the results I need in rows (I'll have
not
more then 65536 results )
UDF :
http://groups.google.ro/group/micros...690a05b5ce5?q=
Here is my code :
Sub AAACOLUMNSOK()
Application.ScreenUpdating = True
Dim FromWks1 As Worksheet
Dim DestWks As Worksheet
Dim NextRow As Long
Dim myCell As Range
Dim myRng1 As Range
Dim i1 As Long
Dim i2 As Long
Dim i3 As Long
Dim i4 As Long
Dim i5 As Long
Dim i6 As Long
Dim i7 As Long
Set FromWks1 = Workbooks("DATABASE Gr VALUE.xls").Worksheets("1")
Set DestWks = Workbooks("RAMSES1.xls").Worksheets("1")
With FromWks1
Set myRng1 = .Range("U2000:AN2000")
End With
With FromWks1
For i1 = 41 To 50
For i2 = i1 + 1 To 51
For i3 = i2 + 1 To 52
For i4 = i3 + 1 To 53
For i5 = i4 + 1 To 54
For i6 = i5 + 1 To 55
For i7 = i6 + 1 To 56
.Range("A2001:A3635") = .Range(Cells("1", i1), _
Cells("1635", i1)).Value
.Range("B2001:B3635") = .Range(Cells("1", i2), _
Cells("1635", i2)).Value
.Range("C2001:C3635") = .Range(Cells("1", i3), _
Cells("1635", i3)).Value
.Range("D2001

3635") = .Range(Cells("1", i4), _
Cells("1635", i4)).Value
.Range("E2001:E3635") = .Range(Cells("1", i5), _
Cells("1635", i5)).Value
.Range("F2001:F3635") = .Range(Cells("1", i6), _
Cells("1635", i6)).Value
.Range("G2001:G3635") = .Range(Cells("1", i7), _
Cells("1635", i7)).Value
For Each myCell In myRng1.Cells
If myCell.Value = "OK" Then
With FromWks1
.Cells(myCell.Row, myCell.Column).AutoFill _
Destination:=.Range(.Cells(myCell.Row,
myCell.Column), .Cells(3635, myCell.Column))
.Range("A2001:G2001").Copy
.Range(.Cells("3640", myCell.Column), .Cells
("3647", myCell.Column)).PasteSpecial , _
Paste:=xlPasteValues, _
Transpose:=True
.Range("A2000:C2000").Copy
.Cells("3636", myCell.Column).PasteSpecial , _
Paste:=xlPasteValues, _
Transpose:=True
myCell.Offset(-3, 0).FormulaR1C1 = "=cuR(R[3]
C:R[55]C)"
End With
Application.CutCopyMode = False
With FromWks1
.Range(.Cells("1997", myCell.Column), .Cells("2050",
myCell.Column)).Copy
End With
With DestWks
NextRow = .Cells(.Rows.Count, "A").End(xlUp).Row + 1
.Cells(NextRow, "A").PasteSpecial ,
Paste:=xlPasteValues, _
Transpose:=True
End With
.Range(.Cells("2001", myCell.Column), .Cells("3633",
myCell.Column)).ClearContents
myCell.Offset(-3, 0).ClearContents
End If
Next myCell
Application.CutCopyMode = False
Next i7
Next i6
Next i5
Next i4
Next i3
Next i2
Next i1
End With
Application.ScreenUpdating = True
End Sub
Thank you very much for helped me again ,
HAVE A GREAT WEEKEND .