+ Reply to Thread
Results 1 to 10 of 10

Combining Subroutines

  1. #1
    Valued Forum Contributor jj72uk's Avatar
    Join Date
    03-22-2008
    Location
    Essex, England
    MS-Off Ver
    Work - Office 2000, Home - Office 2007E
    Posts
    360

    Combining Subroutines

    I've put off posting here and went on a trawl of google with out much luck.

    I have 2 Sub routines, one written by donkey ( plus a duplicate for another sheet)

    Please Login or Register  to view this content.
    Plus I have a Macro

    Please Login or Register  to view this content.
    And what I am trying to do is add the macro to the command button, so its one complete routine.

    I've tried alot of noobish ways:

    Run Marco1()
    Call Marco1()
    With
    Sub

    But, as I'm not good at VBA I havent figured it out.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Combining Sub routines

    What do you want to combine?
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Valued Forum Contributor jj72uk's Avatar
    Join Date
    03-22-2008
    Location
    Essex, England
    MS-Off Ver
    Work - Office 2000, Home - Office 2007E
    Posts
    360

    Re: Combining Sub routines

    1 Command button to run both...

    So something like this...but this wont work:

    Please Login or Register  to view this content.

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Combining Sub routines

    Doesn't that work?

  5. #5
    Valued Forum Contributor jj72uk's Avatar
    Join Date
    03-22-2008
    Location
    Essex, England
    MS-Off Ver
    Work - Office 2000, Home - Office 2007E
    Posts
    360

    Re: Combining Sub routines

    Yes..

    But it does the

    Please Login or Register  to view this content.
    Runs After The second part, and I need it to run first... that part refreshes the web query thats set up.

    So i need the web query (refresh) ran first, then the second part.

  6. #6
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Combining Sub routines

    The refresh should run first,
    Please Login or Register  to view this content.

  7. #7
    Valued Forum Contributor jj72uk's Avatar
    Join Date
    03-22-2008
    Location
    Essex, England
    MS-Off Ver
    Work - Office 2000, Home - Office 2007E
    Posts
    360

    Re: Combining Sub routines

    Thanks for your patiences with this.

    I have plugged in the code you gave and it still runs the wrong way around?

    I'd post the sheet but the web query is on our intranet site only.

  8. #8
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Combining Sub routines

    The web query appears to run first to me

  9. #9
    Valued Forum Contributor jj72uk's Avatar
    Join Date
    03-22-2008
    Location
    Essex, England
    MS-Off Ver
    Work - Office 2000, Home - Office 2007E
    Posts
    360

    Re: Combining Subroutines

    I'll post the sheet on Monday, I'll try and remove anything sensitive.

  10. #10
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Combining Subroutines

    You can test the order by using msgboxes
    Please Login or Register  to view this content.

+ 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