Macro To Copy Rows From One Worksheet To Anot

Solved/Closed
Gowind - Mar 2, 2011 at 05:03 AM
 Gowind - Mar 4, 2011 at 07:48 AM
Hi ,
I'd like to know if there's a macro that can be run to check one worksheet. In this worksheet there is a column where the value should be "true". If this value is true, I'd like to copy the entire row of data into another worksheet which resides at server.
There can be multiple rows of data where this condition is met.Its very urgent please any one help..

Any suggestions would be greatly appreciated.

Thanks ,
Govind

8 responses

well,
its working fine ,but when ever i rum the macro it is fitching records in distination sheet different different locations,how to over come it.and also i am trying to copy the rows from 3 different users to a single file,
is it possible..?,
i am sorry to my blind english language.
4
Thanks for reply,

But i am very new to Macro's ,can you suggest me any reference.
1
venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 811
Mar 2, 2011 at 05:08 AM
autofilter the whole data according to your criteria and copy the filered data to the server. after copying remove the filter can you RECORD the macro and use it.
0
Hi,
I used auto filter but i am getting following error msg

Run-Time error '1004'
Auto Filter method of Range class failed
0
venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 811
Mar 2, 2011 at 08:52 PM
at present do not record the macro.
just manually autofilter and copy the filtered data to another location.
see help on autofilter if necessary

once or twice if your autofilter method is ok then you can RECORD the macro.

what I mean is

1. in the sheet click tools-macro-record macro
2. you accept the name and click olk
3. an icon for stop macro comes up. do not do anything in that icon now
4. now you do your steps. autofilter copying and again stopping the filter etc
5. after successfully doing what you want to do.lclick stop macro icon
6. clear the filtered data you have copied in another sheet
7.now click tools macro-macros and highlight the macro you have recorded (it will be like macaro1 or macro 2 etc).
8. click run on the right side.
9. see what happens.l
9. if there is problem or error post the macro which you have recorded.
0

Didn't find the answer you are looking for?

Ask a question
venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 811
Mar 3, 2011 at 07:53 PM
your recorded macro needs tweaking.
perhaps in the macro when you copy the filtered data to destination sheet this destination sheet remains as activesheet. so when you rerun the macro the destination sheet is the active sheet where as source sheet shd be the active sheet. instead of using the statement activesheet use
worksheets("......).activate in the macro (you must always tweak the RECORDED macro.

post your recorded macro and the way out will be shown to you
0
Great, now its working Fine but i am geting replication of data in destination Workbook,i.e when user runs the macro more than one time the data get duplicating..how to over come this one.
0
venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 811
Mar 4, 2011 at 04:35 AM
before running the macro second time you have to delete the cells in destination field for which you can have a small macro

e.g

sub undo
worksheets("sheet2").cells.clear
end usb 
0
Great its Working Fine.........

Thanks alot.
0