+ Reply to Thread
Results 1 to 2 of 2

How to run multiple VBA routines in excel?

  1. #1
    Registered User
    Join Date
    03-27-2005
    Posts
    13

    How to run multiple VBA routines in excel?

    I'm sure this is easy but I'm real new to VBA.

    I have a subroutine that looks for values in a column and the colors them. The routine works great. But now I want to run a similar but different subroutine for the next column. They both work individually (I cut and paste them from a word doc to test individually).

    Now I want both in the same spreadsheet. I tried putting them in back to back in the VBA editor but the second one does not run. Probably becase the first one ends with an END SUB and it does not go to the next subroutine.

    So I do not know if I need to write 1 huge subroutine or is there a way I can create multiple ones.

  2. #2
    Registered User
    Join Date
    03-28-2005
    Posts
    4
    Magoobee,
    You can just call the second subroutine from the end of the first if you'd like. Or you can run them separately, or have them attached to different command buttons, plenty of options. To call from the first routine do this:

    Private sub FirstRoutine

    program code here

    call SecondRoutine

    End sub

+ 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