Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default Want to move records

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



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default Want to move records

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.
--
Don Guillett
SalesAid Software

"Phillips" wrote in message
news:MEdvb.61764$Dw6.331852@attbi_s02...
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





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel arrows don't move black box but move the window Thebit Excel Discussion (Misc queries) 1 April 13th 09 02:06 AM
Delete records when certain records have duplicate column data JVroom New Users to Excel 1 January 26th 09 06:23 PM
How do I stop making the spreadsht move when I move up/dwn/lt/rt? Manny Excel Worksheet Functions 4 April 7th 06 10:30 PM
When I move scroll bar in excell the contents do not move with it ramneek Excel Discussion (Misc queries) 2 June 29th 05 07:35 PM
Be able to move not delete filtered records, to see the duplicats hmadari Excel Worksheet Functions 4 May 25th 05 09:06 PM


All times are GMT +1. The time now is 06:53 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"