View Single Post
  #9   Report Post  
Gordy w/Hi Expectations
 
Posts: n/a
Default Copying whole rows to different sheet once found

range(e,e.specialcells(xlLastCell).select
range(e,e.offset(intRows,0).select

Couldn't run it because of these two formulas.

"exceluserforeman" wrote:

Hi,
I am doing this off the top of my head and have not tested it but it should
work. It uses the count of the columns and rows to establish the whole row
and the end point in the column. It copies the whole row to a sheet named
"Toddlers". There is no Error handling.

sub Toddlers()
dim VarX, cell as variant
dim strT as string
dim intNRows, intCols,intNum as integer
strT="T"
intRows=0
intCols=0
intNum=0
Sheets("Toddlers").select
Range("B2").select
set b=selection
Sheets("Classroom Attendance This Week").Select
Range("E6").Select
set e=selection
range(e,e.specialcells(xlLastCell).select
intRows=selection.rows.count
intCols=selection.columns.count
e.select
range(e,e.offset(intRows,0).select
set varX =selection
for each cell in varX
if cell.value < strT then
range(cell,cell.offset(0,intCols)).copy
b.offset(intnum,0).paste
application.cutcopymode=false
intnum=intnum+1
end if
next

If you want me to write something more suited, send the worksheet to me at


confidential info is not shared with any person, living or presumed dead.

- - Mark

PS see my stuff at
http://www.geocities.com/excelmarksway



If ActiveCell.Value = "T" Then Return 'Exit Sub
While ActiveCell.Value < "T"
ActiveCell.Offset(1, 0).Activate
Count = Count + 1
Wend



"Gordy w/Hi Expectations" wrote:

Count = 6
Sheets("Classroom Attendance This Week").Select
Range("e6").Select
If ActiveCell.Value = "T" Then Return 'Exit Sub
While ActiveCell.Value < "T"
ActiveCell.Offset(1, 0).Activate
Count = Count + 1
Wend

It's easy enough to find the first one of the (T)oddlers but I need to copy
the whole row to another sheet automatically. Plus I need to find all the "T"
in the 297 rows and preferrably copy all the rows at once without blanks
between rows.
Help would be good.