Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7696491
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T21:47:28+00:00 2026-05-31T21:47:28+00:00

I have multiple excel workbooks each representing a days data, each workbook has multiple

  • 0

I have multiple excel workbooks each representing a days data, each workbook has multiple sheets representing each event on the day..

i need to run 6 macros in order across each sheet in a workbook and then move on to the next workbook (all the workbooks are in the same folder on the desktop)

at the moment im using this (below) to run the macros in order across all the sheets but im having trouble trying to get somthing to run across all of the workbooks

Sub RUN_FILL()
Dim sh As Worksheet

For Each sh In ThisWorkbook.Worksheets
sh.Activate

Call macro_1
Call macro_2  
Call macro_3  
Call macro_4  
Call macro_5  
Call macro_6

Next sh
End Sub

any idea how i might do this ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T21:47:29+00:00Added an answer on May 31, 2026 at 9:47 pm

    I do not have your macros so I have created dummy macros that output some values to the Immediate window for every sheet of every workbook (except the workbook containing the macro).

    You code appears to depend on the output macro activating each worksheet. This is bad practice. I pass the workbook and the worksheet name to the the macros. I output the value of cell A1 (.Cells(1, 1).Value) to show how it is done.

    I hope this is enough to get you started. Ask if anything is unclear.

    Option Explicit
    Sub ControlCall()
    
      Dim FileNameCrnt As String
      Dim InxWSheet As Long
      Dim MsgErr As String
      Dim PathCrnt As String
      Dim RowReportCrnt As Long
      Dim WBookCtrl As Workbook
      Dim WBookOther As Workbook
      Dim WSheetNameOtherCrnt As String
    
      If Workbooks.Count > 1 Then
        ' It is easy to get into a muddle if there are multiple workbooks
        ' open at the start of a macro like this.  Avoid the problem.
        Call MsgBox("Please close all other workbooks " & _
                    "before running this macro", vbOKOnly)
        Exit Sub
      End If
    
      Application.ScreenUpdating = False
    
      Set WBookCtrl = ActiveWorkbook
    
      ' Assume all the workbooks to be processed are in the
      ' same folder as the workbook containing this macro.
      PathCrnt = WBookCtrl.Path
    
      ' Add a slash at the end of the path if needed.
      If Right(PathCrnt, 1) <> "\" Then
        PathCrnt = PathCrnt & "\"
      End If
    
      FileNameCrnt = Dir$(PathCrnt & "*.xl*")
    
      Do While FileNameCrnt <> ""
    
        If FileNameCrnt <> WBookCtrl.Name Then
          ' Consider all workbooks except the one containing this macro
          Set WBookOther = Workbooks.Open(PathCrnt & FileNameCrnt)
    
          For InxWSheet = 1 To WBookOther.Worksheets.Count
            WSheetNameOtherCrnt = WBookOther.Worksheets(InxWSheet).Name
    
            Call macro_1(WBookOther, WSheetNameOtherCrnt)
            Call macro_2(WBookOther, WSheetNameOtherCrnt)
            Call macro_3(WBookOther, WSheetNameOtherCrnt)
            Call macro_4(WBookOther, WSheetNameOtherCrnt)
            Call macro_5(WBookOther, WSheetNameOtherCrnt)
            Call macro_6(WBookOther, WSheetNameOtherCrnt)
          Next
          WBookOther.Close SaveChanges:=False
        End If
     FileNameCrnt = Dir$()
    Loop
    
    Application.ScreenUpdating = True
    
    End Sub
    Sub macro_1(WBookOther As Workbook, WSheetNameOtherCrnt As String)
    
      With WBookOther
        With .Worksheets(WSheetNameOtherCrnt)
          Debug.Print "1 " & WBookOther.Name & " " & _
                      WSheetNameOtherCrnt & " " & .Cells(1, 1).Value
        End With
      End With
    
    End Sub
    Sub macro_2(WBookOther As Workbook, WSheetNameOtherCrnt As String)
    
      With WBookOther
        With .Worksheets(WSheetNameOtherCrnt)
          Debug.Print "2 " & WBookOther.Name & " " & _
                      WSheetNameOtherCrnt & " " & .Cells(1, 1).Value
        End With
      End With
    
    End Sub
    Sub macro_3(WBookOther As Workbook, WSheetNameOtherCrnt As String)
    
      With WBookOther
        With .Worksheets(WSheetNameOtherCrnt)
          Debug.Print "3 " & WBookOther.Name & " " & _
                      WSheetNameOtherCrnt & " " & .Cells(1, 1).Value
        End With
      End With
    
    End Sub
    Sub macro_4(WBookOther As Workbook, WSheetNameOtherCrnt As String)
    
      With WBookOther
        With .Worksheets(WSheetNameOtherCrnt)
          Debug.Print "4 " & WBookOther.Name & " " & _
                      WSheetNameOtherCrnt & " " & .Cells(1, 1).Value
        End With
      End With
    
    End Sub
    Sub macro_5(WBookOther As Workbook, WSheetNameOtherCrnt As String)
    
      With WBookOther
        With .Worksheets(WSheetNameOtherCrnt)
          Debug.Print "5 " & WBookOther.Name & " " & _
                      WSheetNameOtherCrnt & " " & .Cells(1, 1).Value
        End With
      End With
    
    End Sub
    Sub macro_6(WBookOther As Workbook, WSheetNameOtherCrnt As String)
    
      With WBookOther
        With .Worksheets(WSheetNameOtherCrnt)
          Debug.Print "6 " & WBookOther.Name & " " & _
                      WSheetNameOtherCrnt & " " & .Cells(1, 1).Value
        End With
      End With
    
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an excel workbook in which there is data from multiple text files.
I am having few excel files where each file have multiple workbooks. Assume following
I have a few hundred Excel files, where each file has some data on
I am using Excel 2007 with a workbook that has many sheets. I need
I need to export multiple data tables to Excel on the clients machine, each
Can I have multiple threads in Excel. I need a counter to show the
Is this possible in Excel? I have a workbook with multiple worksheets. I wrote
WPF, Excel AddIn, C#, I have multiple asychronous calls to get data from web
I have multiple excel files which I open as datatable I want to merge
I have multiple threads (C# application running on IIS) running that all need to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.