+ Reply to Thread
Results 1 to 10 of 10

Macro to copy and paste special values for column data and filter column data

  1. #1
    Registered User
    Join Date
    01-29-2011
    Location
    Upland, California
    MS-Off Ver
    Office 365
    Posts
    32

    Macro to copy and paste special values for column data and filter column data

    Hello everyone,

    I am using Excel 2010:

    Update: I have, through much trial and error figured out how to resolve all of my issues below except for how to create a macro to filter column data. In attempting to record the macro to filter the column, I keep receiving the error message as follows: "Too many line continuations". Can anyone help with this?

    My issue is that I have the attached spreadsheet where a tab "DISTRIBUTE" contains data that is pulled from other tabs within the workbook by means of VLOOKUP. There are 2000 rows of Vlookup formulas to pull data.

    I'm trying to create a macro that will manipulate column data within the "DISTRIBUTE" tab as follows:

    1.) Copy concatenated phone numbers, ex:0123456789, from column "P" (the formulas are active) and paste/special value them into column "Q". Then format the phone numbers, ex: (012) 345-6789.

    2.) Filter out column "A" data, "0" and "(Blanks)"

    3.) Filter out column "B" data, anything that is NOT "0" and "(Blanks)"

    4.) Sort the entire worksheet by column "J", ascending, and hide columns, "B", "G", "J", "N", "O", "P". - This I have been able to do successfully as a separate macro.

    I have tried solutions for other posters from this site as well as the web, all of which have not worked for my particular situation.

    I have tried both recording and writing the macro but neither have worked for me.

    My goal is to create a single macro that when launched will accomplish all of the above. Is this even possible?

    Thank you,

    any help would be greatly appreciated!
    Attached Files Attached Files
    Last edited by ascottbag; 03-10-2012 at 02:18 PM.

  2. #2
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Macro to copy and paste special values for column data and filter column data

    Hi ascottbag
    When you say
    Filter out column "A" data, "0" and "(Blanks)"
    and
    Filter out column "B" data, anything that is NOT "0" and "(Blanks)"
    do you mean "Delete those rows"?
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  3. #3
    Registered User
    Join Date
    01-29-2011
    Location
    Upland, California
    MS-Off Ver
    Office 365
    Posts
    32

    Re: Macro to copy and paste special values for column data and filter column data

    Thanks Jaslake,

    What I'm attempting to do is utilize the Excel filter control. Upon re-opening the filter control and re-selecting the previously de-selected check boxes I would be able to again view the complete data.

  4. #4
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Macro to copy and paste special values for column data and filter column data

    Hi ascottbag
    "Gotta be honest with you...not sure what you're looking for. Based on my understanding, see if this does it for you
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    01-29-2011
    Location
    Upland, California
    MS-Off Ver
    Office 365
    Posts
    32

    Re: Macro to copy and paste special values for column data and filter column data

    Almost there!

    Column "B" is displaying only the "0" and blank cell data which is what I'm looking for.

    Column "A" is now displaying the contact ID's that I'm looking for but is still displaying the blank cells.

    What I'm trying to emulate is going to column "A" opening the filter control, de-selecting the check box for "0" and "(Blanks)" then clicking "OK" to run the filter. Then going to column "B" opening the filter control, de-selecting all check boxes except for "0" and "(Blanks)" and clicking "OK" to run the filter.

    When I manually use the filter controls as above, my data row count = 818 of 1999 records found.

  6. #6
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Macro to copy and paste special values for column data and filter column data

    Hi ascottbag
    Try this code
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    01-29-2011
    Location
    Upland, California
    MS-Off Ver
    Office 365
    Posts
    32

    Thumbs up Re: Macro to copy and paste special values for column data and filter column data

    Jaslake,

    Your code worked perfectly! Thank you! I can see that I still have quite a bit to learn with VBA code.

    I'm marking this post as solved, but if it's not too much trouble, can you help out with code that would restore the data to its original state where all of the data rows are visible and counted? I tried playing with your code to accomplish this but no luck so far.

    Again, thank you for your knowledge and help!

  8. #8
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Macro to copy and paste special values for column data and filter column data

    Hi ascottbag
    You're welcome...glad I could help.

    Either of these will do it
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    01-29-2011
    Location
    Upland, California
    MS-Off Ver
    Office 365
    Posts
    32

    Re: Macro to copy and paste special values for column data and filter column data

    Worked like a charm!

    Again, thank you!

  10. #10
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Macro to copy and paste special values for column data and filter column data

    My pleasure.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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