I am trying move rows of data that don't match a criteria on site from one sheet to another. As the sheets are many I need to do this by code as the criteria changes for each sheet.
In the case below I need to move the entire row where Site = #N/A
I have tried the following but it will not work (I have left out where the site data is passed from for brevity):
Sub MoveText
dim cell as object
Range([D2],[D2].end(xldown)).select
For Each cell in Selection
If cell<> 1300 Or cell<> 1400 Then
cell.entirerow.cut
sheets("MixedCase").select
[A1].end(xldown).Offset(1,0).paste pastespecial:=xlvalues
sheets("Raws").select
end if
next cell
end sub
I hope Colo's code displays as all I can see is HTML.
cheers
Flyfisher
In the case below I need to move the entire row where Site = #N/A
I have tried the following but it will not work (I have left out where the site data is passed from for brevity):
Sub MoveText
dim cell as object
Range([D2],[D2].end(xldown)).select
For Each cell in Selection
If cell<> 1300 Or cell<> 1400 Then
cell.entirerow.cut
sheets("MixedCase").select
[A1].end(xldown).Offset(1,0).paste pastespecial:=xlvalues
sheets("Raws").select
end if
next cell
end sub
Book1 | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | |||
1 | Item | LogCode | AbbCode | Site | 200208 | 200209 | 200210 | 200211 | 200212 | 200213 | ||
2 | 59970 | 59970 | WNA | 1400 | 0 | 0 | 0 | 800 | 850 | 0 | ||
3 | 5824 | 59980 | WNB | 1400 | 0 | 800 | 800 | 0 | 0 | 0 | ||
4 | 24221 | 60570 | OTW | #N/A | 0 | 500 | 500 | 500 | 500 | 500 | ||
5 | 5825 | 59960 | WNC | #N/A | 0 | 800 | 800 | 0 | 0 | 800 | ||
6 | 24220 | 89970 | OBW | 1300 | 0 | 1200 | 1200 | 1200 | 0 | 1200 | ||
Raws |
I hope Colo's code displays as all I can see is HTML.
cheers
Flyfisher