![]() |
#2
|
|||
|
|||
![]()
Well, i did find a solution....
Looks Like this: Sub NextAll() Dim col As Range, row As Range, Myrange As Range Set col = Worksheets("Foaie1").Range("J3") If Worksheets("Foaie1").Range("J3") = 10 Then Worksheets("Foaie2").Range("A3:A6").Copy Worksheets("Foaie1").Range("A3").PasteSpecial (xlPasteValues) Exit Sub End If Set Myrange = Range(Worksheets("Foaie2").Cells(3, col), Worksheets("Foaie2").Cells(6, col)) Myrange.Copy Worksheets("Foaie1").Range("A3").PasteSpecial (xlPasteValues) On Error GoTo 0 End Sub This macro depends on evaluation formula in cell "J3", which is: =IF(ISERROR(MATCH(A3;Foaie2!A3:I3;0)+1)=TRUE;0;MAT CH(A3;Foaie2!A3:I3;0)+1) To copy row by row instead of a range of rows, just change the copy range to 1 row I am sure there are better solutions... but this works fine for me, so I will give many thanks to me ![]() I will atach the file again for those interested. Have a great day |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
Learner7 | Excel | 1 | 07-28-2010 12:07 PM |
How can I fill cell color starting from Cell D5 using Conditional formatting instead | Learner7 | Excel | 0 | 07-08-2010 05:50 AM |
How can I make a cell color RED under the Today's date cell? | Learner7 | Excel | 2 | 07-08-2010 12:52 AM |
![]() |
mrphilk | Excel | 4 | 06-10-2010 11:52 PM |
Auto-populate an MS Word table cell with text from a diff cell? | dreamrthts | Word Tables | 0 | 03-20-2009 01:49 PM |