Hi Everyone,
i have worksheet with columns A to CH. i will filter certain data and now have to copy some of the columns from that filtered data to new work book.
can any one suggest how we can do that using code?
Regards
Rajeev
Hi Everyone,
i have worksheet with columns A to CH. i will filter certain data and now have to copy some of the columns from that filtered data to new work book.
can any one suggest how we can do that using code?
Regards
Rajeev
code? as in VBA?
If you are satisfied with the solution(s) provided, please mark your thread as Solved.
Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.
yes. once i filter a set of data, i need only that filtered data and some columns to new workbook.
Last edited by irajeev; 07-22-2015 at 09:11 PM.
use range.specialcells method
https://msdn.microsoft.com/en-us/lib.../ff196157.aspx
range.specialcells(xlCellTypeVisible).copy
Sorry mate. i have not got experience in coding at all. Can you provide me the entire code as an example. thanks for your help on this.
Regards
Rajeev
you cant really have a blanket answer to a broad question....(1 code that works for everything all the time)
you are going to have to provide something to work with
i completely agree with you. below is similar format. if i filter by only vendor x, and would like to copy columns ( end User, Vendor, Start date, and ACCT)to new worksheet.Hope this is helpful. let me know if you need any further info.
End User Vendor Start Date End Date Stage Notes ACCT
a x 24/06/2015 25/07/2016
b y 24/07/2015 25/08/2016
c z 24/08/2015 25/09/2016
d x 24/09/2015 25/10/2016
e y 24/10/2015 25/11/2016
f z 24/11/2015 25/12/2016
next time ...provide a worksheet when asked for sample data
people do not want to data entry for you in order to answer your question
ive setup a simple example of autofilter using J9 value (highlighted in yellow)
Sorry dnt look at this option at all. if i filter by customer "a", then i need to copy columns "A to C", "E","G" to new workbook not sheet
you want to run macro after you have filtered or you want the macro to filter for you?
also new blank workbook?
Last edited by humdingaling; 07-23-2015 at 10:31 PM.
Run the macro after done the filtering and filtered data with the desired columns to be on the new workbook. there will be different customers. so when i ever i select a customer, that filtered date along with the columns to be on new work book. new workbook should not have any macros.
its be much easier to copy everything across and delete columns that you dont want after wards then to select certain columns of information at a time
see attached if it matches your requirements
Thanks a lot for this. but i have columns till CH. so it is big file. and 1500 different users. so it might take so much of time to copy some of the columns from every user.
unless you have left something out
the code only copied across the filtered data so the 1500 users comment is invalid
and if you only require 5 out of the first 7 columns only the 7 columns would be copied across so having up to CH doesn't matter?
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks