+ Reply to Thread
Results 1 to 3 of 3

Run macros after last one finished

Hybrid View

  1. #1
    Registered User
    Join Date
    01-27-2020
    Location
    england
    MS-Off Ver
    office 365, excel version 1912
    Posts
    53

    Run macros after last one finished

    Hi is it possible to automatically run a macro when one has finished ?

    example 1st macro would run

    Sub FORMULAS_TO_VALUES()
        Dim i As Integer
        Dim cell As Range
        For i = 1 To 91
         For Each cell In Worksheets(CStr(i)).Range("F1:F1,aa4:aa75,aM4:bM75").Cells
            cell.Value = cell.Value
         Next cell
        Next i
    End Sub
    then when finished next macro would run

    Sub SHEETS_TO_HOME()
    Dim sht As Worksheet, csheet As Worksheet
    
    Application.ScreenUpdating = False
    Set csheet = ActiveSheet
    
    For Each sht In ActiveWorkbook.Worksheets
      If sht.Visible Then
        sht.Activate
        Range("CM1").Select
        ActiveWindow.ScrollRow = 1
        ActiveWindow.ScrollColumn = 1
      End If
    Next sht
    
    csheet.Activate
    Application.ScreenUpdating = True
        MsgBox "complete"
    Exit Sub
    out:
        MsgBox "copy was cancelled"
        Application.ScreenUpdating = True
    End Sub
    once finished next macro would run

    Sub AUTO_CALCULATE_SOME_CELLS()
    Dim i As Long
        For i = 1 To 95
            With Sheets(CStr(i)).Select
           
    
    Range("IC4:ID75").Calculate
    Range("JF4:JF75").Calculate
    Range("F4:F75").Calculate
    Range("Q4").Calculate
    Range("Q8").Calculate
    Range("Q12").Calculate
    Range("Q16").Calculate
    Range("Q20").Calculate
    Range("Q24").Calculate
    Range("Q28").Calculate
    Range("Q32").Calculate
    Range("Q36").Calculate
    Range("Q40").Calculate
    Range("Q44").Calculate
    Range("Q48").Calculate
    Range("Q52").Calculate
    Range("Q56").Calculate
    Range("Q60").Calculate
    Range("Q64").Calculate
    Range("Q68").Calculate
    Range("Q72").Calculate
    
            End With
        Next
    
    End Sub

  2. #2
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,565

    Re: Run macros after last one finished

    Hi ste33uk,

    Here's one way:

    Sub RunMyMacros()
    
        Call FORMULAS_TO_VALUES
        Call SHEETS_TO_HOME
        Call AUTO_CALCULATE_SOME_CELLS
    
    End Sub
    Regards,

    Robert
    ____________________________________________
    Please ensure you mark your thread as Solved once it is. Click here to see how
    If this post helps, please don't forget to say thanks by clicking the star icon in the bottom left-hand corner of my post

  3. #3
    Registered User
    Join Date
    01-27-2020
    Location
    england
    MS-Off Ver
    office 365, excel version 1912
    Posts
    53

    Re: Run macros after last one finished

    Quote Originally Posted by Trebor76 View Post
    Hi ste33uk,

    Here's one way:

    Sub RunMyMacros()
    
        Call FORMULAS_TO_VALUES
        Call SHEETS_TO_HOME
        Call AUTO_CALCULATE_SOME_CELLS
    
    End Sub
    Regards,

    Robert
    Thanks robert i think i can make that work if i change the way some of my macros end, thanks

+ 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. Is it possible in VBA to tell when a worksheet has finished calculations?
    By pizzaboyuk in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-06-2018, 02:45 PM
  2. Run second macro after first has finished
    By Parmx in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-21-2018, 12:15 AM
  3. Do loop error when finished
    By Dooey123 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-07-2015, 12:22 PM
  4. [SOLVED] Restart Sub when Finished
    By rodgersmg in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-12-2015, 04:03 AM
  5. Know when .cmd has finished
    By krayten in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-14-2006, 06:25 PM
  6. msg box with finished time, please read
    By Rowan in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-06-2005, 04:05 AM
  7. msg box with finished time, please read
    By Greegan in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 10:05 PM

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