Copy rows to master sheet
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.
then set the #wanted to zero.
I assume total cost is calculated with a formula, so setting #wanted to zero
would make total cost zero.
to find the next available row on the master sheet
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
--
Regards,
Tom Ogilvy
"Carolyn" wrote in message
om...
I have spent more hours than I care to admit trying to figure out the
code for copying rows that have updated date to a master sheet. I
have a command button on the bottom of four sheets that I want the
user to press and send information that has changed to the master
sheet. I want them to be in sequential order (no spaces).
Upon sending it, I want the changes to the cells to revert to the
original state. They are supply order forms. The only thing that
changes is the number of units that someone wants and the total price
for the units.
For example:
Sku# Item Name #Wanted Unit Price Total Cost
blabla towels 4 $2.00 $8.00
After they send the information to the master sheet, I want the number
wanted and total cost to revert to zero.
The sheets are named according to the product...The first sheet is
named "Cleaning Supplies".
Can someone please help me? I feel like I have read through every
posting and can't figure it out. I usually do not use excel, but the
client that I am working for prefers it.
Thank you in advance for any help.
Carolyn
|