Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy entire row if...
I need help copying entire row from "table1.xls" if column B is "text1" to
"table2.xls". what is the most simple way of doing this? Thanks -- -Sam |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy entire row if...
If Cells(2,"B") = "text1" Then Cells(2,"B").Entirerow.Copy Destination:=Workbooks("table2.xls").Worksheets("S heet1").Range("A1") End If -- HTH RP (remove nothere from the email address if mailing direct) "Sam" wrote in message ... I need help copying entire row from "table1.xls" if column B is "text1" to "table2.xls". what is the most simple way of doing this? Thanks -- -Sam |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy entire row if...
Thanks Bob, that was very helpful. There is still one more detail I want to
solve. I want to be able to put more than one row in destination table, so that the data is saved always to next empty row. Because of this I can't order the certain range. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy entire row if...
Sam,
Try something like If Cells(2,"B") = "text1" Then Set oWS = Workbooks("table2.xls").Worksheets("Sheet1") cLastRow = oWS.Cells(Rows.Count,"A").End(xlUp).Row Cells(2,"B").Entirerow.Copy Destination:=.oWS.Cells(cLastRow+1,"A") End If -- HTH RP (remove nothere from the email address if mailing direct) "Sam" wrote in message ... Thanks Bob, that was very helpful. There is still one more detail I want to solve. I want to be able to put more than one row in destination table, so that the data is saved always to next empty row. Because of this I can't order the certain range. |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy entire row if...
then change to this idea
With workbooks"table2.xls").worksheets("sheet1") If Cells(2,"B") = "text1" Then x = .Cells(Rows.Count, 1).End(xlUp).Row + 1 Cells(2, "b").EntireRow.Copy .Cells(x, 1) End With end if End Sub If Cells(2,"B") = "text1" Then Cells(2,"B").Entirerow.Copy Destination:=Workbooks("table2.xls").Worksheets("S heet1").Range("A1") End If -- Don Guillett SalesAid Software "Sam" wrote in message ... Thanks Bob, that was very helpful. There is still one more detail I want to solve. I want to be able to put more than one row in destination table, so that the data is saved always to next empty row. Because of this I can't order the certain range. |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy entire row if...
Thanks guys! Now it works
|
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy entire row if...
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Copy entire row to different worksheet | Excel Worksheet Functions | |||
Copy entire ranges | Excel Worksheet Functions | |||
how to copy entire row into next row | Excel Programming | |||
Code to copy range vs Copy Entire Worksheet - can't figure it out | Excel Programming | |||
Copy entire Worksheet how? | Excel Programming |