+ Reply to Thread
Results 1 to 16 of 16

No experience, special copy and paste column macro

  1. #1
    Registered User
    Join Date
    10-01-2014
    Location
    houston
    MS-Off Ver
    2007
    Posts
    13

    No experience, special copy and paste column macro

    Hi,

    I have zero experience in VBA macro. There's a worksheet that I'm working on that requires many steps and I was wondering if it's possible to combine it into a single macro.

    1. Copy and paste column B through G starting starting at row 2 and paste into a new worksheet in a single column.
    2. After the data is in a new worksheet, I would also like for it Sort that column from A through Z
    3. Then insert a new row to give a column a header name called "Description"
    4. Then do a subtotal count function on that column

    I'm not sure if it's possible but any help would be appreciated. I've included the excel sheet and thank you so much in advance!
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: No experience, special copy and paste column macro

    Its possible...anythings possible with VBA


    Can you just confirm step 1, what do you mean by paste into a single column?

    are you saying that if in columns B to G you have (I've shown columns seperated by
    A;BC;1;EFG;H;AAAAA;

    you want it to take that, concatenate the values and output "ABC1EFGHAAAAA" into a cell on the new worksheet?

  3. #3
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: No experience, special copy and paste column macro

    Hello shuynh84,

    Since the data in the workbook are not numbers, there can be no subtotal.

    Did mean you wanted the entry count inserted below the alphabetical groups?
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  4. #4
    Registered User
    Join Date
    10-01-2014
    Location
    houston
    MS-Off Ver
    2007
    Posts
    13

    Re: No experience, special copy and paste column macro

    Like I want to copy all the data from column B through column G and paste it all in a single column under column A on a new sheet. I know you can manually do it by using the paste all function from the clipboard. You can copy all the columns you want and then use clipboard to do a paste all and it'll paste everything you have copied onto the clipboard.

  5. #5
    Registered User
    Join Date
    10-01-2014
    Location
    houston
    MS-Off Ver
    2007
    Posts
    13

    Re: No experience, special copy and paste column macro

    what i've been doing is manually copy and paste all the columns i want into a single column.
    then i select the single column sort it from a through z.
    then I insert a heading for the column called Description
    Then I use the subtotal command, function is count....then it does the count for me

    I've attached another excel sheet to show what the result is suppose to be.

    Sorry for all the confusion. I'm pretty bad with explaining things lol
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: No experience, special copy and paste column macro

    The 1st thing Id ask from your results is, do you really need all the data in that second sheet or will the subtotals themselves do? The reason I ask is when you expand the Pivot, theres no additional data there just a list (sometimes in the thousands) of the same value (take C01 as an example). Do you really need to be able to expand that or would the list of totals give you what you need?

  7. #7
    Registered User
    Join Date
    10-01-2014
    Location
    houston
    MS-Off Ver
    2007
    Posts
    13

    Re: No experience, special copy and paste column macro

    I basically just need the total count for each value from column B through G with the exception of row 1 cause it's just a header row....the reason it's all there because it's the only way I know how to count them using the subtotal function

  8. #8
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: No experience, special copy and paste column macro

    Hello shuynh84,

    This should be close to what you want. A new sheet "Result" has been added along with a button to run the macro.

    The sorted results are in column "A" while columns "B" and "C" display the unique entries and their counts.

    Please Login or Register  to view this content.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    10-01-2014
    Location
    houston
    MS-Off Ver
    2007
    Posts
    13

    Re: No experience, special copy and paste column macro

    thank you so much for your help! When I tried the code on a different excel sheet, it doesn't seem to work properly and is there anyway you can make it so it will add another page and call it "Count?"
    Sorry for asking so much =/

    Sorry, I attached the wrong file earlier. This is the right file now
    Attached Files Attached Files
    Last edited by shuynh84; 10-31-2014 at 09:27 AM.

  10. #10
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: No experience, special copy and paste column macro

    Hello shuynh84,

    The macro has been updated to add the sheet "Count". If the sheet already exists then it will be cleared when the macro runs.

    It has been added to the attached workbook.

    Revised Macro
    Please Login or Register  to view this content.
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    10-01-2014
    Location
    houston
    MS-Off Ver
    2007
    Posts
    13

    Re: No experience, special copy and paste column macro

    thank you for the quick response. When I hit run...The result didn't come out right =/

  12. #12
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: No experience, special copy and paste column macro

    Hello shuynh84,

    Please explain what it did not do correctly.

  13. #13
    Registered User
    Join Date
    10-01-2014
    Location
    houston
    MS-Off Ver
    2007
    Posts
    13

    Re: No experience, special copy and paste column macro

    Oh no I see it now. It's doing what it's suppose to...just it's doing it for all the columns instead of just from B through G only. How do i adjust it so it's only doing column B through G only? and thank you so much for the quick reply

  14. #14
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: No experience, special copy and paste column macro

    Hello shuynh84,


    Sorry, about that. This workbook covers columns B:G.
    Attached Files Attached Files

  15. #15
    Registered User
    Join Date
    10-01-2014
    Location
    houston
    MS-Off Ver
    2007
    Posts
    13

    Re: No experience, special copy and paste column macro

    wow........thank you so much for your help! I didn't think this was possible....seriously....you just saved me a TON of time from this repetitive task.

  16. #16
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: No experience, special copy and paste column macro

    Hello shuynh84,

    You're welcome. Happy Halloween.

+ 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. [SOLVED] No Experience – Need a specific copy and paste macro
    By shuynh84 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-31-2014, 03:15 PM
  2. [SOLVED] Simple copy and paste macro- Paste special help needed.
    By hernancrespo in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-20-2012, 07:02 AM
  3. Replies: 0
    Last Post: 09-18-2012, 11:47 AM
  4. [SOLVED] Macro to find SKU in column; then copy data in row and paste special (values)
    By Starkey in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-13-2012, 06:05 AM
  5. Macro to copy and paste special values for column data and filter column data
    By ascottbag in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 03-10-2012, 02:15 PM

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