+ Reply to Thread
Results 1 to 6 of 6

Copy, Paste values from One workbook To another, no header

  1. #1
    Registered User
    Join Date
    07-12-2013
    Location
    Ottawa
    MS-Off Ver
    Excel 2010
    Posts
    22

    Copy, Paste values from One workbook To another, no header

    Hi,

    I need to hide columns, copy visible data below the header from workbook 1, Open workbook 2 and paste the selection from workbook 1 into the next available row.

    I have provided the code I have been working with below and any suggestions would be greatly appreciated. Please let me know if more information is required.

    Please Login or Register  to view this content.

  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: Copy, Paste values from One workbook To another, no header

    Hi knevil,

    Try 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
    Registered User
    Join Date
    07-12-2013
    Location
    Ottawa
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: Copy, Paste values from One workbook To another, no header

    Thanks for the response xladept,

    It still does not want to paste the selected range. Error at ActiveSheet.Range("A" & Rows.count).End(xlUp).Offset(1).Paste (nothing to paste)

    Once the 2nd workbook is opened it loses the info on the clipboard and stops the code.

    Is there a way to keep the information copied from the first workbook Active or would it have to be called after the workbook is open?


    Please Login or Register  to view this content.

  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: Copy, Paste values from One workbook To another, no header

    Maybe:

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    07-12-2013
    Location
    Ottawa
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: Copy, Paste values from One workbook To another, no header

    Hi Xladept

    The sub routine works. The paste function is doing exactly what is needed. Is there a way to clean up the copy section of the sub routine and Only have one SET statement.

    Is it possible to combine Set rng and Set R to speed up the code?

    Set rng = Range("A3:DL" & Range("A3:DL3").End(xlDown).row): 'rng.Activate

    Range( _
    "F:K,O:Q,U:U,W:AC,AE:AJ,AN:AN,AP:AP,AR:AR,AT:AT,AV:AY,BA:BD,BF:BF,BI:BM,BP:BQ,BS:CC,CE:DE" _
    ).EntireColumn.Hidden = True
    Set R = ActiveSheet.UsedRange.SpecialCells(xlCellTypeVisible)

    You help is greatly appreciated and I have added to your reputation, thank you.

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

    Re: Copy, Paste values from One workbook To another, no header

    Hi Knevil,

    Yes, you're not doing anything with rng so you could just get rid of it or swap it for R and dump the R - Thanks for the rep

    Please Login or Register  to view this content.

+ 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. Copy paste last row from each workbook in master workbook on header criteria
    By farrukh in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-30-2013, 07:28 AM
  2. Open workbook, filter values, copy/paste into Active workbook.
    By niceguy21 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-10-2013, 12:17 PM
  3. [SOLVED] Copy columns by header value and paste them in a specific order into another workbook
    By KeriM in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-21-2012, 11:13 AM
  4. Copy All Sheets and Paste Values To New Workbook
    By jkelly228 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-02-2011, 06:42 AM
  5. VBA to copy and paste values for all sheets in a workbook
    By LB79 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-21-2008, 05:39 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