+ Reply to Thread
Results 1 to 2 of 2

Code to copy extract from one workbook to another

  1. #1
    Registered User
    Join Date
    06-25-2014
    Location
    scotland
    MS-Off Ver
    2010
    Posts
    5

    Code to copy extract from one workbook to another

    Hi,

    jewelsharmaear previously kindly provided me with the code below to check our master staff list and copy and paste service specific extracts to relevantly names worksheets within the same workbook. I'm eondering if it would be possible to paste the extracts to a seperate workbook rather than to sheets within original workbook.

    The original workbook is named master stafflist and I would like to paste to a workbook called service extract.

    Any help would be much appreciated.

    Thank you.

    ---------
    Sub Copy_Rows_To_Worksheet()
    Dim iRow as Integer, iPasteRow as Integer, sWs as string
    With ThisWorkbook.Worksheets("Staff List")
    For iRow = 2 to .Cells(.Rows.Count, "A").End(xlUp).Row
    sWs = .Range("A" & iRow)
    iPasteRow = ThisWorkbook.Worksheets(sWs).Cells(Rows.Count, "A").End(xlUp).Row + 1
    .Range("A" & iRow & ":V" & iRow).Copy Destination:= ThisWorkbook.Worksheets(sWs).Range("A" & iPasteRow & ":V" & iPasteRow)
    Next iRow
    End With
    End Sub
    ---------

  2. #2
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Code to copy extract from one workbook to another

    Please use code tags when posting. Refer too Forum Rule No. 3. It's possible. You would need to change this line:

    Please Login or Register  to view this content.
    To:

    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. VBA code to copy a range from open workbook to another workbook
    By Frank Harrison in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-01-2014, 09:21 AM
  2. [SOLVED] Code to copy data from a closed workbook and paste in active workbook using named range.
    By paullie1912 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 02-28-2014, 02:38 AM
  3. Extract data from closed workbooks and copy into new workbook
    By philaugust2004 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-15-2013, 07:45 AM
  4. Copy from Extract in one workbook to specific cell range in other
    By Michelle Deigh in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-20-2013, 09:07 AM
  5. Code to open a workbook , copy info and return it to another workbook using a cell v.
    By england79m in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-31-2008, 11:22 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