+ Reply to Thread
Results 1 to 17 of 17

Help please: Creating Macro to filter & copy Data

  1. #1
    Registered User
    Join Date
    06-19-2014
    Location
    Essex
    MS-Off Ver
    MS Office 2010 or 2013
    Posts
    21

    Help please: Creating Macro to filter & copy Data

    Hi guys, first time poster so I hope you can help. I seldom use Excel anymore as I prefer to use Access for large quantity of data.


    I have a spreadsheet I need some help with. this has columns begining with A to S (with data in it)

    It has rows begining on row 5 and goes down to 85 but it gets bigger every day.

    I want to create a macro with several phases

    Phase 1 - Select the rows I specify, ie pop up box to decide on the rows
    Phase 2 - Filter down and select the rows in this selection where coulmn K has a value (unselecting the rest)
    Phase 3 - Copying Coulmns A, B, D, E, F, K, from the selection
    Phase 4 - Pasting these coulmns into A, B, C, D, E, F, of the sheet the macro sits on


    I hope this makes sense.
    Last edited by kacey8; 06-19-2014 at 11:48 AM.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,882

    Re: Help please: creating a macro to do a lot of work.....

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution.

    Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.

    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Help please: creating a macro to do a lot of work.....

    How do you propose copying 6 columns of data (A,B,D,E,F,K) and pasting 7 columns of data (A,B,C,D,E,F,G)?

  4. #4
    Registered User
    Join Date
    06-19-2014
    Location
    Essex
    MS-Off Ver
    MS Office 2010 or 2013
    Posts
    21

    Re: Help please: creating a macro to do a lot of work.....

    All done for you Alansidman....


    As for the columns, this is a mistake and changed.

  5. #5
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,882

    Re: Help please: Creating Macro to filter & copy Data

    kacey;
    Thanks for making the change. If you post a sample spreadsheet of your data, it will be easier to design and test a macro that will work for you. Here is how to upload a sample workbook.

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

  6. #6
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Help please: Creating Macro to filter & copy Data

    Give this a try and see how it goes:

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    06-19-2014
    Location
    Essex
    MS-Off Ver
    MS Office 2010 or 2013
    Posts
    21

    Re: Help please: Creating Macro to filter & copy Data

    Okay, so I have run through and confirmed the desensitied information.

    On the master sheet, the green cells is the "range" I want to copy, on the before is the results page before running it, and after is obviously after I have run it (basically it copys the cells and filters them if there is content in coulmn K.

    The black cells is where I deleted the content for censoring (I highlighted it black to indicate there is data in the cells


    The main point is whilst there are only 20 examples here, the number of rows will fluxuate and change, sometimes from 80 to 100 or even 200 etc
    Attached Files Attached Files

  8. #8
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Help please: Creating Macro to filter & copy Data

    Edited to accomidate your workbook. Try this:

    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    06-19-2014
    Location
    Essex
    MS-Off Ver
    MS Office 2010 or 2013
    Posts
    21

    Re: Help please: Creating Macro to filter & copy Data

    Hi,

    Thanks for that. I am getting an error

    "Can't find project or Library" and when I click ok, it opens "References and has a few items with ticks in them"

    "Visual Basic for Applications"
    "Microsoft Excel 12.0 Object Library"
    "OLE Automation"
    "MISSING: Microsoft Calender Control 8.0"

    Tried unclicking the "Missing" reference but now I just get the error

    "Cannot run the macro "Project - Desensities.xls'!Macroname'. The macro may not be available in this workbook or all macros may be disabled"

    however, Macro Security is set to "Enable all macros" and I have "Trust access to the ABA orject object model" ticked as well.


    EDIT: Nevermind, I think I fixed it myself
    Last edited by kacey8; 06-20-2014 at 03:45 AM.

  10. #10
    Registered User
    Join Date
    06-19-2014
    Location
    Essex
    MS-Off Ver
    MS Office 2010 or 2013
    Posts
    21

    Re: Help please: Creating Macro to filter & copy Data

    Thank you so much, so the macro working but it is not picking up the entire range I select (it only gives me down to a certain limit so now I am working on the larger spreadsheet it only gives me the first 22 rows of data filtered down and anything post 22rows is ignored.
    Last edited by kacey8; 06-20-2014 at 04:29 AM.

  11. #11
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Help please: Creating Macro to filter & copy Data

    Hmm. I bet you have blank spaces in your selected range.

    Please Login or Register  to view this content.
    Last edited by stnkynts; 06-20-2014 at 10:21 AM.

  12. #12
    Registered User
    Join Date
    06-19-2014
    Location
    Essex
    MS-Off Ver
    MS Office 2010 or 2013
    Posts
    21

    Re: Help please: Creating Macro to filter & copy Data

    Yes Sir.... yes I did (although I can make there not be blanks (but if that works instead for the endRow I thank you so much.

  13. #13
    Registered User
    Join Date
    06-19-2014
    Location
    Essex
    MS-Off Ver
    MS Office 2010 or 2013
    Posts
    21

    Re: Help please: Creating Macro to filter & copy Data

    stnkynts,

    You're amazing and that worked perfectly, now to make matters worse, some of the cells which we are filtering (Column K) have a 0.00 in there. I questioned whether a 0 value needed to be there but apparently they do, is there anyway though to stop these filtering through with the results? so basically 0.00 is NOT included in the copied cells.

  14. #14
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Help please: Creating Macro to filter & copy Data

    Please Login or Register  to view this content.

  15. #15
    Registered User
    Join Date
    06-19-2014
    Location
    Essex
    MS-Off Ver
    MS Office 2010 or 2013
    Posts
    21

    Re: Help please: Creating Macro to filter & copy Data

    You... are AMAZING...

    Works perfectly. Thank you very much

  16. #16
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,882

    Re: Help please: Creating Macro to filter & copy Data

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  17. #17
    Registered User
    Join Date
    06-19-2014
    Location
    Essex
    MS-Off Ver
    MS Office 2010 or 2013
    Posts
    21

    Re: Help please: Creating Macro to filter & copy Data

    Quote Originally Posted by alansidman View Post
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.
    haha... was just about too and you didn't give me chance :p you arte obviously on the ball,

    Thank you everyone.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Desperately need help creating a macro based tool for work!
    By kylenls in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-03-2013, 10:56 AM
  2. Making one Macro work for any range of cells instead of creating several
    By liberator14 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-29-2013, 06:02 PM
  3. Replies: 6
    Last Post: 07-25-2012, 07:55 AM
  4. Creating Macro to work with outlook??
    By hootywho2 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-03-2007, 05:11 AM
  5. [SOLVED] creating an invoice for work
    By Beth in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1