Want to move records

  • Thread starter Thread starter Phillips
  • Start date Start date
P

Phillips

I would like to move records based on a flag.

I do NOT want to just copy the record.

How do you do this?

I would like to walk the records, and then if the flag is true, them move it
to a diff worksheet.
I imagine it would be something like:


sub MoveRec
reccount= RowCount
for i =1 to reccount
if active.cell(0,3) then
Worksheets("Sheet1").Range("A:ZZ").Cut
ActiveSheet.Paste Destination:=Worksheets("Sheet2").Range("A:ZZ")
endif

next i
end sub

Will this work? I don't want to try it until I get somebodys OK that this
will do what I want it to do.

Is there a better way to do this?
Thanks
Phil
 
I see a couple of things
if active.cell(0,3) then
if the offset cell = ________???
Worksheets("Sheet1").Range("A:ZZ").Cut
ActiveSheet.Paste Destination:=Worksheets("Sheet2").Range("A:ZZ")

Worksheets("Sheet1").Range("A:ZZ").Cut _
Worksheets("Sheet2").Range("A:ZZ")

This should help. Don't be afraid to experiment if you don't SAVE and/or you
have a backup.
 
Back
Top