ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Transfering Data To another Workbook or Sheet (https://www.excelbanter.com/excel-programming/343982-transfering-data-another-workbook-sheet.html)

Crowbar via OfficeKB.com

Transfering Data To another Workbook or Sheet
 
I need to be able to transfer whole rows that contain anything that either
has a value greater than 10 within one column or greater than 250 in another.

When they are transfered, I need them not to overwrite the current data on
that sheet but find the next emtpy rows and place them there.

Hope you can help me


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200510/1

Tom Ogilvy

Transfering Data To another Workbook or Sheet
 
Dim rng as Range, cell as Range
with worksheets("Sheet1")
set rng = .Range(.Cells(2,1),.Cells(rows.count,1).End(xlup))
End with
for each cell in rng
if rng.offset(0,3) 10 or rng.offset(0,5)<250 then
rng.EntireRow.Copy Destination:=worksheets("Sheet2") _
.Cells(rows.count,1).end(xlup)(2)
end if
Next

rng.offset(0,3) is column D
rng.offset(0,5) is column F

adjust to fit

assumes column A in the source data is always populated.

--
Regards,
Tom Ogilvy


"Crowbar via OfficeKB.com" <u15117@uwe wrote in message
news:5677b9ef328a3@uwe...
I need to be able to transfer whole rows that contain anything that either
has a value greater than 10 within one column or greater than 250 in

another.

When they are transfered, I need them not to overwrite the current data on
that sheet but find the next emtpy rows and place them there.

Hope you can help me


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200510/1





All times are GMT +1. The time now is 06:00 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com