Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    Join Date
    Oct 2005
    Location
    Calgary, Alberta
    Posts
    205
    Thanks
    0
    Thanked 1 Time in 1 Post

    Run a macro with in a Macro (Excel 2000)

    I have look through the search and can seem to find how I can call up a macro within my code. Ithough I could just type in the Codes sub name??

    ex.
    'Calls ErrCheaker Code
    ErrChecker



    Dim oDiJISSalesOK, oDiJISProgramNumber, oDiJISCompanyName, oDiJISWellLocation, oDiJISjobtype As Object

    Dim vi, i, iDiJisAttachmentsCount As Integer

    '************************************************* ************************************************** *****
    'Calls ErrCheaker Code
    ErrChecker
    '************************************************* ************************************************** *****
    Dim bLastSavedFullExists, bNeedToCreateNewDiJisItem As Boolean
    Dim oDiJIS As Object
    Dim oDiJISNamespace

    Dim oDiJISField As Object


    'Set varible string to:
    sProgramNumber = Range("ProgramNumber").Value ' from Named cell - eg FSH001LT
    swelllocation = Range("WellLocation").Value
    sprogramfolder = Range("ProgramFolder").Value ' eg L:CalfracSales - Programs
    sMonthYearFolder = Range("MonthYearFolder").Value ' eg August 2002

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Run a macro with in a Macro (Excel 2000)

    Either use the name of the macro, as in your example, or use the keyword Call:

    Call ErrChecker

    However, spelling must be consistent, you mention both ErrCheaker and ErrChecker.

    This will work if the other macro has been defined in a standard module (i.e. one created by selecting Inseet | Module) in the same workbook.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •