Results 1 to 3 of 3

Macro to run macros from different worksheets

Threaded View

  1. #1
    Registered User
    Join Date
    10-23-2012
    Location
    Charlote, NC
    MS-Off Ver
    Excel 2007
    Posts
    2

    Macro to run macros from different worksheets

    I need a macro that I can assign to a button on the first of four worksheets, that will run a specific macro I've written for each of the 3 other worksheets. I tried writing a macro that called each of the other macros I needed, but it ran all of them on sheet 2. I need it to call and run macro 2 on sheet 2 only, macro 3 on sheet 3 only, etc. Coding for each macro to a specific sheet is in the general form below.

    Sub SectionB_Add_Loan()
    '
    ' Adds additional loan to Section B
    '
        Columns("F:F").Select
        Selection.Copy
        Selection.Insert Shift:=xlToRight
        Application.CutCopyMode = False
        
        Dim lLastCol As Long
        
        lLastCol = ((Sheet4.UsedRange.Column + _
                     Sheet4.UsedRange.Columns.Count) - 47)
        
        With Sheet4
            .Range("D4:E4").AutoFill .Range( _
                    .Cells(4, 4), .Cells(4, lLastCol)), xlFillDefault
        End With
    End Sub
    Last edited by rcarder1; 11-01-2012 at 09:31 AM. Reason: conform to forum rules

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