Re: Excel - Copy select rows
Select the range into a range object.
Sort the range on the first column/char.
Use code or a find to get the top and bottomw rows.
Change the range to the top and bottom and copy.
Paste into the new sheet.
Should be possible. Perhaps a sort is all you need?
Re: Excel - Copy select rows
I agree with ECNIV but here's VBA in case you want it .... I hope this is right because this is the first time I've posted VBA (just a beginner)
Name a range on your spreadsheet.....we'll say "data" in cell A1 and your numbers start in A2. For sheet2 name a range we'll call "data2"
y=1
x=1
Do until range("data").offset(x,0) = ""
Do
If trim(left(range("data").offset(x,0)),1) = "5" then
Range("data").Offset(x, 0).EntireRow.Select
Sheets("sheet2").Select
Range("data2").Offset(y, 0).EntireRow.Select
ActiveSheet.Paste
Sheets("sheet1").Select
exit do
end if
x=x+1
Loop until trim(left(range("data").offset(x,0)),1) = "5"
y=y+1
Loop
end sub