+ Reply to Thread
Results 1 to 2 of 2

Looping through opened workbooks

Hybrid View

  1. #1
    Registered User
    Join Date
    01-02-2013
    Location
    ind.
    MS-Off Ver
    Excel 2010
    Posts
    3

    Looping through opened workbooks

    hi!

    i have managed to get a code which opens all files existing in a folder. now i want to run a macro(Called as donemovementReport) on these files one by one like as it runs on
    one i save the file then run on the next one.

    The Macro donemovementreport pastes all data from these open sheets to a template. i want to save this tamplate not the opened workbook which carries the actual data.

    anybody with some idea?

    
    Sub OpenAllWorkbooks()
    Set destWB = ActiveWorkbook
    Dim DestCell As Range
    FileNames = Application.GetOpenFilename( _
            filefilter:="Excel Files (*.csv*),*.csv*", _
            Title:="Select the workbooks to load.", MultiSelect:=True)
    If IsArray(FileNames) = False Then
        If FileNames = False Then
            Exit Sub
        End If
    End If
    For n = LBound(FileNames) To UBound(FileNames)
        Set wb = Workbooks.Open(fileName:=FileNames(n), ReadOnly:=True)
        
     Next n
     
     'Dim i As Integer
     'i = ActiveWorkbook.AcceptAllChanges
     
     
     'For i = 1 To ActiveWorkbook
     
     
     
     
     Call donemovementReport
    
    'Next i
    
     End Sub

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

    Re: Looping through opened workbooks

    http://www.rondebruin.nl/copy3.htm
    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)

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