> just loop through the #wanted column and copy any rows that are not zero.
> Place the row in the next available row on the master sheet.
[quoted text clipped - 47 lines]
> >
> > Carolyn
I gave you the code that does it.
Sub Copyrows()
Dim rng as Range, rng1 as Range
With Worksheets("Cleaning Supplies)
set rng = .Range(.cells(2,1),.Cells(rows.count,1).end(xlup))
End With
for each cell in rng
if cell.offset(0,2) <> 0 then
set rng1 = Worksheets("Master").Cells(rows.count,1).end(xlup)(2)
cell.EntireRow.copy Destination:=rng1
cell.offset(0,2).Value = 0
end if
Next
End Sub
Now I have added the declaration for the code.
Paste it into a general module in your workbook. Change the names of the
sheets to match your situation.
then do Tools=>Macro=>Macros
highlight Copyrows and click run

Signature
Regards,
Tom Ogilvy
> Tom,
>
[quoted text clipped - 57 lines]
> > >
> > > Carolyn
David McRitchie - 23 May 2004 19:19 GMT
Hi Carolyn,
The code explicitly names both sheets (master and
one of your other sheets), you can actually run the macro
while you are on any worksheet.
There is a typo in the macro as it is missing the ending
double quote after "cleaning supplies" which should
show up as RED indicating a syntax error when you
paste the code into a module. One other thing with
Options Explicit all variables including the variable
"cells" should be declared (dimensioned) for that
you would have received an error indicating an
undeclared variable.
You can use a macro without understanding exactly
how it works. Test on a copy of your workbook.
To retest make sure there are item counts on your
Cleaning Supplies worksheet.
So Tom's code is
Option Explicit
Sub Copyrows()
Dim rng As Range, rng1 As Range, cell As Range
With Worksheets("Cleaning Supplies")
Set rng = .Range(.Cells(2, 1), .Cells(Rows.Count, 1).End(xlUp))
End With
For Each cell In rng
If cell.Offset(0, 2) <> 0 Then
Set rng1 = Worksheets("Master").Cells(Rows.Count, 1).End(xlUp)(2)
cell.EntireRow.Copy Destination:=rng1
cell.Offset(0, 2).Value = 0
End If
Next
End Sub
Tom gave you instructions to intall and run the code, but
if that doesn't work out for you. You could look over my
page Getting Started with Macros
http://www.mvps.org/dmcritchie/excel/getstarted.htm
---
HTH,
David McRitchie, Microsoft MVP - Excel
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
[please refer to the thread for 2 intermediate replies]
> "Carolyn" <carolynaevans@cox.net> wrote in message...
> > I have spent more hours than I care to admit trying to figure out the
[quoted text clipped - 18 lines]
> > named "Cleaning Supplies".
> > ---Carolyn