Thread
:
Copying whole rows to different sheet once found
View Single Post
#
9
Don Guillett
Posts: n/a
Copying whole rows to different sheet once found
Did you look at my "cleaned up" version ?
--
Don Guillett
SalesAid Software
"Gordy w/Hi Expectations"
wrote in message ...
I got down to
Worksheets("Classroom Attendance This Week").Activate
Range("e6").Select
Columns("E:E").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="T"
Then in the recording you copy the rows selected, but they will change
over
time.
I can't seem to get the right thing to copy them automatically.
I've tried Selection.Rows.Copy, and Rows(Selection).Copy.
"Don Guillett" wrote:
recorded. See below for cleanup
Sub Macro8()
'
' Macro8 Macro
' Macro recorded 10/30/2005 by Don Guillett
'
'
Range("A1").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="t"
Rows("10:27").Select
Selection.Copy
Sheets("Sheet8").Select
Rows("6:6").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Sheets("Sheet7").Select
Selection.AutoFilter
Range("D3").Select
End Sub
=======
Sub Macro8fixed()'from source sheet
Range("A1").AutoFilter Field:=1, Criteria1:="t"
Rows("10:27").Copy Sheets("Sheet8").Rows("6:6")
Range("a1").AutoFilter
End Sub
--
Don Guillett
SalesAid Software
"Don Guillett" wrote in message
...
Why not sort or autofilter and copy the visible cells all at once.
Record
a
macro while doing and then clean it up to get rid of the selections
which
are rarely desirable or necessary.
--
Don Guillett
SalesAid Software
"Gordy w/Hi Expectations"
wrote in message
...
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.
Reply With Quote