+ Reply to Thread
Results 1 to 10 of 10

Trying to copy selected columns instead of a range. Trying to find a solution

  1. #1
    Forum Contributor
    Join Date
    01-21-2012
    Location
    Charlotte, NC
    MS-Off Ver
    Excel 2010
    Posts
    106

    Trying to copy selected columns instead of a range. Trying to find a solution

    Hey everyone, I have another problem I need to solve. How could I alter the script below to copy specific columns, B, H J to the destination sheet starting in column B? I I'm stumped on this. Trying to find a solution but so far not able.


    Please Login or Register  to view this content.
    Last edited by anthony1312002; 10-12-2017 at 02:58 PM.

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Trying to copy selected columns instead of a range. Trying to find a solution

    Something like this:


    Please Login or Register  to view this content.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Forum Contributor
    Join Date
    01-21-2012
    Location
    Charlotte, NC
    MS-Off Ver
    Excel 2010
    Posts
    106

    Re: Trying to copy selected columns instead of a range. Trying to find a solution

    How would I apply the pastespecial?

  4. #4
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Trying to copy selected columns instead of a range. Trying to find a solution

    By using another row (the colon does that) -
    Please Login or Register  to view this content.
    and thanks for the rep!

  5. #5
    Forum Contributor
    Join Date
    01-21-2012
    Location
    Charlotte, NC
    MS-Off Ver
    Excel 2010
    Posts
    106

    Re: Trying to copy selected columns instead of a range. Trying to find a solution

    No problem. Thank you for your great help!!
    Last edited by anthony1312002; 10-13-2017 at 07:46 AM.

  6. #6
    Forum Contributor
    Join Date
    01-21-2012
    Location
    Charlotte, NC
    MS-Off Ver
    Excel 2010
    Posts
    106

    Re: Trying to copy selected columns instead of a range. Trying to find a solution

    Hey xladept,

    I'm getting a PasteSpecial Method or Range class failed error. Why would that be?

    Please Login or Register  to view this content.

  7. #7
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Trying to copy selected columns instead of a range. Trying to find a solution

    Because the whole column won't fit if you're not pasting from the first row.
    Last edited by xladept; 10-13-2017 at 12:00 PM.

  8. #8
    Forum Contributor
    Join Date
    01-21-2012
    Location
    Charlotte, NC
    MS-Off Ver
    Excel 2010
    Posts
    106

    Re: Trying to copy selected columns instead of a range. Trying to find a solution

    So how do I get around that? Sorry if I seem a little lost.

  9. #9
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Trying to copy selected columns instead of a range. Trying to find a solution

    Maybe:

    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    10-12-2017
    Location
    Brazil
    MS-Off Ver
    2016
    Posts
    59

    Re: Trying to copy selected columns instead of a range. Trying to find a solution

    Good afternoon.
    The special paste method requires that the target worksheet be selected.
    Select the spreadsheet and destination cell in your code, and use the special activecell.pastes
    Something like this:
    Sheets3.range ("a1"). Select
    activecell.PasteSpecial xlPasteValues

+ 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. Replies: 3
    Last Post: 03-31-2017, 02:43 PM
  2. [SOLVED] Solution to copy a range of cells and paste in another Worbook w/o using an input box
    By kwesmc1 in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 03-29-2017, 06:41 PM
  3. [SOLVED] Subscript is out of range Error - can't find solution
    By JJFletcher in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 04-16-2016, 12:18 PM
  4. Replies: 9
    Last Post: 11-20-2015, 04:20 AM
  5. [SOLVED] Need help with a find and copy entire row solution
    By AutoKAD in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-14-2013, 12:35 AM
  6. [SOLVED] Compare two columns (including a Left and Find solution too)
    By phrankndonna in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-09-2012, 12:08 PM
  7. Find Highest Value in Selected Columns
    By aljanga in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-09-2009, 02:41 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