+ Reply to Thread
Results 1 to 2 of 2

Copy range from closed excel workbook into master file + finding next empty row

  1. #1
    Registered User
    Join Date
    08-22-2013
    Location
    Tilburg
    MS-Off Ver
    Excel 2010
    Posts
    1

    Copy range from closed excel workbook into master file + finding next empty row

    Hi guys,

    i'm a real novice in VBA programming and could really use your help

    currently i am setting up a project data base where people fill in a project file. This file is then saved into H:\Medical\Project management\Projects. then in my overview file a selected amount of cells are then copies from those project files. Now I found a code and adjust it to find this directory and scan for all the "xl*" files. then it copies a range of cells (A2:J2) to the overview file starting at "A5".

    now I have 2 problems
    1) every time I have to select the "xl*" file I want the code to cope paste the desired range (A2:J2) into my overview file starting at (A5). I would like the code to find all "xl*" files and take A2:J2 from every file, every time I run the code
    2) currently the code keeps rewriting into Cell A5 and doesn't find the next empty row.

    This is the code i have so far. Could you guys help me with that?

    Thanks!

    PHP Code: 
    Sub GetData_Example4()
        
    Dim SaveDriveDir As StringMyPath As String
        Dim FName 
    As Variant

        SaveDriveDir 
    CurDir
        MyPath 
    "H:\Medical\Project management\Projects"   'or use "C:\Data"
        ChDrive MyPath
        ChDir MyPath
        FName = Application.GetOpenFilename(filefilter:="Excel Files, *.xl*")

        If FName = False Then
            '
    do nothing
        
    Else
            
    GetData FName"Sheet1""A2:J2"Sheets("Sheet1").Range("A5"), FalseFalse
        End 
    If

        
    ChDrive SaveDriveDir
        ChDir SaveDriveDir
    End Sub 

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Copy range from closed excel workbook into master file + finding next empty row

    you missed sub getdata
    If solved remember to mark Thread as solved

+ 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 specific rows from many files and paste into next empty row in master file
    By Rednalyn in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 07-08-2013, 09:13 AM
  2. Excel 2007 : Copy Range From Closed Workbook
    By marzook in forum Excel General
    Replies: 1
    Last Post: 01-06-2011, 08:01 AM
  3. Copy from template to first empty row in a master workbook?
    By dylanemcgregor in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 01-06-2010, 02:28 PM
  4. Copy data from new everyday csv file to next empty row in master excel file
    By hablu in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-18-2009, 02:06 AM
  5. [SOLVED] Copy range from closed file
    By nc in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 03-15-2005, 02:06 PM

Tags for this Thread

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