Dear Paul Really great thanks for help. Regards Shrinivas
On Fri, Feb 5, 2016 at 6:08 PM, Paul Schreiner <schreiner_p...@att.net> wrote: > Change your macro to: > Sub MyFilter() > Dim lngStart As Long, lngEnd As Long, thisWB As Workbook > Dim NewWB As Workbook > > Set thisWB = ActiveWorkbook > '----------------------------------------- > ' Create a new workbook > '----------------------------------------- > Workbooks.Add > ActiveWorkbook.SaveAs Filename:=thisWB.Path & "\filter.xls" > Set NewWB = ActiveWorkbook > '----------------------------------------- > ' ActiveWorkbook.Close savechanges:=False > '----------------------------------------- > ' Return to original workbook > '----------------------------------------- > thisWB.Activate > thisWB.Sheets("Data").Select > '----------------------------------------- > lngStart = Range("f1").Value > lngEnd = Range("g1").Value > Range("a1:a3000").AutoFilter Field:=1, _ > Criteria1:=">=" & lngStart, _ > Operator:=xlAnd, _ > Criteria2:="<=" & lngEnd > Range("A1").Select > Range(Selection, Selection.End(xlDown)).Select > Range(Selection, Selection.End(xlToRight)).Select > Selection.Copy > '----------------------------------------- > ' Select Destination workbook > '----------------------------------------- > NewWB.Activate > Sheets("Sheet1").Select > Range("A1").Select > ActiveSheet.Paste > '----------------------------------------- > ' Close New Workbook > '----------------------------------------- > NewWB.Close savechanges:=True > '----------------------------------------- > thisWB.Activate > Sheets("Data").Select > Selection.AutoFilter > ActiveWorkbook.Save > > End Sub > *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* > ----------------------------------------- > > > On Friday, February 5, 2016 5:34 AM, Shrinivas Shevde < > shrinivas...@gmail.com> wrote: > > > > Dear Paul > Thanks for reply. > Cant get it. > Can you please modify it for me and send it back > Thanks in Advance > Regards > Shrinivas > > On Thu, Feb 4, 2016 at 6:16 PM, Paul Schreiner <schreiner_p...@att.net> > wrote: > > In your macro, you CREATE the new workbook: > > Workbooks.Add > ActiveWorkbook.SaveAs Filename:=thisWB.Path & "\filter.xls" > > But then you immediately CLOSE it! > ActiveWorkbook.Close savechanges:=False > > So, then when you filter the data, copy it to the clipboard and select > Sheet1, > it's in the CURRENT workbook, not the new one. > you need to: > > skip closing the workbook. > after filter/copy to clipboard, select the destination workbook before > pasting. > > 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* > ----------------------------------------- > > > On Thursday, February 4, 2016 5:10 AM, Shrinivas Shevde < > shrinivas...@gmail.com> wrote: > > > > > Dear All > Please find attached sheet which contain macro. > Basically there is data in sheet Book "Filter Macro". > I need to filter this data on Date basis and filter data need to paste in > new workbook. > Every time filter data then new wokbook will be created. > Now my problem is that its filterd the data ,create new workbook but dta > is not getting paste. > Please let me know where I am making mistake. > > -- > Shrini > -- > 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 https://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 https://groups.google.com/group/excel-macros. > For more options, visit https://groups.google.com/d/optout. > > > > > -- > Shrini > -- > 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 https://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 https://groups.google.com/group/excel-macros. > For more options, visit https://groups.google.com/d/optout. > -- Shrini -- 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 https://groups.google.com/group/excel-macros. For more options, visit https://groups.google.com/d/optout.