Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 2 of 2

Thread: Need Help!!!!

  1. #1
    New Member
    Join Date
    Mar 2002
    Posts
    8
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I'm in need of VBA code that will collect data from a range in different excel files that are located in different directories with different file names, and each with their own password. Then paste the data ranges from all the files in a central file which will then be used for statistical purposes.

    Thanks in advanced.

    L.

  2. #2
    Board Regular
    Join Date
    Feb 2002
    Location
    Finland
    Posts
    76
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi.
    You could try method where location of files are on excel sheet, on column A. Column B has file name, and column C passwd.

    Important! file location in sheet must be in format \networkdrive_path, not in networkdrive letter.

    sub open_all
    a=1
    while cells(a,1).value <>""
    file_location=cells(a,1).value
    file_name= cells(a,2).value
    file_passwd=cells(a,2).value
    workbooks.open file_location & file_name password=file_passwd
    call copy_data
    wend
    end sub

    function copy_data
    I think you can personaly code this, this would be easy, activate workbook, then worksheet, select range, copy, close activewindow, paste to central function, into first blank row
    end function

    HTH
    donalde

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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