Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2007
    Stalybridge, Manchester

    Unanswered: Export from Excel to Excel

    I'm just thinking out loud, but is it possible to take data from a spreadsheet held in another folder and export certain ranges and paste into another spreadsheet?

    I have been trying to look through the archives for information on this, does anyone have any ideas of how I can do this or know any threads I could read?


  2. #2
    Join Date
    Oct 2003
    Yes. I assume you want to use VBA for this. Just be sure you know the path (and don't change it after setting up the code). Another way is to have the user open the file that you want to copy from/paste to.
    old, slow, and confused
    but at least I'm inconsistent!

    (retired Excel 2003 user, 3/28/2008)

    How to ask a question on forums

  3. #3
    Join Date
    Apr 2007
    Stalybridge, Manchester
    I have used this code below which copies a range of data from one workbook to another, which works fine. I want to take this to another level. How can I copy data from a workbook to another workbook, but not knowing where the last row is

    Sub copyDataToOtherWorkbook()
        Dim wbTo   As Workbook
        Dim wbFrom As Workbook
        Set wbFrom = ThisWorkbook
        Application.ScreenUpdating = False
        Set wbTo = Workbooks.Open("F:\DataDatabase.xls", False, False)
        With wbTo.Sheets("Database")
            .Range("Data").Value = wbFrom.Sheets("DataFrom").Range("DataPaste").Value
            .Close True
        End With
        MsgBox "All Data Updated"
        Application.ScreenUpdating = True
        Set wbTo = Nothing
        Set wbFrom = Nothing
    End Sub
    How can I do this?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts