+ Reply to Thread
Results 1 to 2 of 2

Opening a series of excel files from cell references

  1. #1
    Registered User
    Join Date
    03-06-2009
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    1

    Opening a series of excel files from cell references

    Hello,

    I want to use this script to open a series of excel files, take column C and make a single spreadsheet from it. The filenames are stored in column a of Data 2007.xls but I keep having a problem with "Workbooks.Activate Filename:=FN". Is there something else I can use? I am a beginner to VB programming and all help would be much appreciated.

    Thanks!



    Sub Macro8()

    Dim i As Integer
    Dim y As Integer
    Dim row As Integer
    Dim FN As String

    i = 1
    y = -1
    row = -1
    FN = Range("A1")

    Do

    i = i + 1
    y = y + 1
    row = row + 1

    Windows("Data 2007.xls").Activate
    Range("A1").Select
    ActiveCell.Offset(row, 0).Select
    FN = ActiveCell

    '' To open

    Workbooks.Activate Filename:=FN
    Columns("C:C").Select
    Selection.Copy
    Windows("Total_2007.xls").Activate
    Columns("C:C").Select
    ActiveCell.Offset(0, y).Select
    ActiveSheet.Paste

    Loop Until i = 51

    End Sub
    Last edited by VBA Noob; 03-06-2009 at 01:56 PM.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    re: Opening excel files from cell references

    Welcome to the forum.

    Please take a few minutes to read the Forum Rules, and then edit your post to wrap your code with Code Tags.
    Entia non sunt multiplicanda sine necessitate

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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