If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > Export from Excel to Excel

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-10-08, 07:48
JezLisle JezLisle is offline
Registered User
 
Join Date: Apr 2007
Location: Stalybridge, Manchester
Posts: 273
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?

Thanks
Reply With Quote
  #2 (permalink)  
Old 10-14-08, 21:08
shades shades is offline
Registered User
 
Join Date: Oct 2003
Posts: 1,091
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!

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

How to ask a question on forums
Reply With Quote
  #3 (permalink)  
Old 11-03-08, 04:03
JezLisle JezLisle is offline
Registered User
 
Join Date: Apr 2007
Location: Stalybridge, Manchester
Posts: 273
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

Code:
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?
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On