Mr PRADEEP, Mr. Abhishek may be being a bit "snarky", but he has correctly answered your question. Yes, "we" can. But because there's not NEARLY enough information in your question, we'd either have to begin asking for lots more information, or make assumptions. You didn't give us much to go on.- You're filtering column "S", so you've got between 19 and 16,384 columns If you're using Excel 2007 or newer. To be safe, perhaps we should stop at column 256 (IV) For my example, I'll "assume" you have 74 columns. just because I do. - You said you "can" have 50 lines (rows?) Does that mean 50 rows AFTER column S is filtered? Or you have 50 rows TOTAL (including the header?) My sample data has 21,481 rows, so I'll use that. - You said "with 10 names" What are "names"? Named Ranges? values in column "S"? (why would that matter?) I have no idea, so I'll disregard that. - You're "filtering" column "S"... how? With nothing else to go on, I'll "assume" you're removing blank values. - You want to "paste" the filtered data to a "new workbook" and "save it". Since I don't know what filename you want, I'll call it "thisisthenameofanewworkbook" (because I can be snarky too!) Since you didn't mention a specific file type, I'll save it as an .xlsb file because I prefer that type. - In the title of your post, you said "save it on desktop". So at least we have a location.
- Now typically, I prefer NOT to use the Windows clipboard for copy/paste. It's CPU intensive, and CAN be damaged if you happen to be using it for something else while your program is running.But this program seems simple enough that it ought to be safe to use. So, with the help of a macro recorder, and sample data I copied from a random selection of data in one of my files, I came up with this macro (comments added for clarity) Sub Copy_Filtered_Data() '---------------------------------------------------------------------------- ' Filter data to remove rows with blank values in column "S" '---------------------------------------------------------------------------- ActiveSheet.Range("$A$1:$BV$21481").AutoFilter Field:=19, Criteria1:="<>" '---------------------------------------------------------------------------- ' Select rows from Cell A1 to Cell XFD51 and copy to Clipboard '---------------------------------------------------------------------------- Range("BV51").Activate Range("A1:BV51").Copy '---------------------------------------------------------------------------- ' Open New Workbook and paste data from Clipboard '---------------------------------------------------------------------------- Workbooks.Add Range("A1").Select ActiveSheet.Paste Application.CutCopyMode = False '---------------------------------------------------------------------------- ' Save new file as "thisisthenameofanewworkbook" and close '---------------------------------------------------------------------------- ActiveWorkbook.SaveAs _ Filename:="C:\Users\(youruseridgoeshere)\Desktop\thisisthenameofanewworkbook.xlsb", _ FileFormat:=xlExcel12, _ CreateBackup:=False Workbooks("thisisthenameofanewworkbook.xlsb").Close End Sub I hope this helps. Paul ----------------------------------------- “Do all the good you can, By all the means you can, In all the ways you can, In all the places you can, At all the times you can, To all the people you can, As long as ever you can.” - John Wesley ----------------------------------------- From: Abhishek Jain <abhishek....@gmail.com> To: MS EXCEL AND VBA MACROS <excel-macros@googlegroups.com> Sent: Wednesday, October 7, 2015 2:37 AM Subject: Re: $$Excel-Macros$$ filter and copy/paste in new workbook and save it on desktop Yes, we can. On Sun, Oct 4, 2015 at 3:47 PM, PRADEEP KUMAR KOKNE <pradeepkumar...@gmail.com> wrote: Hello all, Can you write code for to filter(Column S)-> select the complete visible data and paste it in new workbook and save it. Example: Column S can have 50 lines data with 10 names Thanks -- Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ https://www.facebook.com/discussexcel FORUM RULES 1) Use concise, accurate thread titles. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get quick attention or may not be answered. 2) Don't post a question in the thread of another member. 3) Don't post questions regarding breaking or bypassing any security measure. 4) Acknowledge the responses you receive, good or bad. 5) Jobs posting is not allowed. 6) Sharing copyrighted material and their links is not allowed. NOTE : Don't ever post confidential data in a workbook. Forum owners and members are not responsible for any loss. --- You received this message because you are subscribed to the Google Groups "MS EXCEL AND VBA MACROS" group. To unsubscribe from this group and stop receiving emails from it, send an email to excel-macros+unsubscr...@googlegroups.com. To post to this group, send email to excel-macros@googlegroups.com. Visit this group at http://groups.google.com/group/excel-macros. For more options, visit https://groups.google.com/d/optout. -- Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ https://www.facebook.com/discussexcel FORUM RULES 1) Use concise, accurate thread titles. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get quick attention or may not be answered. 2) Don't post a question in the thread of another member. 3) Don't post questions regarding breaking or bypassing any security measure. 4) Acknowledge the responses you receive, good or bad. 5) Jobs posting is not allowed. 6) Sharing copyrighted material and their links is not allowed. NOTE : Don't ever post confidential data in a workbook. Forum owners and members are not responsible for any loss. --- You received this message because you are subscribed to the Google Groups "MS EXCEL AND VBA MACROS" group. To unsubscribe from this group and stop receiving emails from it, send an email to excel-macros+unsubscr...@googlegroups.com. To post to this group, send email to excel-macros@googlegroups.com. Visit this group at http://groups.google.com/group/excel-macros. For more options, visit https://groups.google.com/d/optout. -- Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ https://www.facebook.com/discussexcel FORUM RULES 1) Use concise, accurate thread titles. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get quick attention or may not be answered. 2) Don't post a question in the thread of another member. 3) Don't post questions regarding breaking or bypassing any security measure. 4) Acknowledge the responses you receive, good or bad. 5) Jobs posting is not allowed. 6) Sharing copyrighted material and their links is not allowed. NOTE : Don't ever post confidential data in a workbook. Forum owners and members are not responsible for any loss. --- You received this message because you are subscribed to the Google Groups "MS EXCEL AND VBA MACROS" group. To unsubscribe from this group and stop receiving emails from it, send an email to excel-macros+unsubscr...@googlegroups.com. To post to this group, send email to excel-macros@googlegroups.com. Visit this group at http://groups.google.com/group/excel-macros. For more options, visit https://groups.google.com/d/optout.