+ Reply to Thread
Results 1 to 4 of 4

Global Functions, Variables etc. Setup help in excel 2010

  1. #1
    Registered User
    Join Date
    07-27-2012
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    8

    Global Functions, Variables etc. Setup help in excel 2010

    Hey guys,

    I'm working on a macro that involves a bunch of the same kind of loop, just with one slight difference to each (the column, which is determined by input from a ComboBox). I'm using whatever version of VBA comes with Excel 2010.

    First of all; where/how do I declare global variables? Also, can I go to the same place where I declare global variables (if there is one) and make a Global Subroutine or function or something, that I can then just make a call to in my code?
    So like I write a loop, but where I need to specify the column I fill with something else, then in my "Private Sub" I can just make a call to said Global Subroutine, and from the Private Sub, specify which column I want it to start in?

    I want to do this because I think it would save me from having to write out the same two loops over and over again!


    Thanks!

  2. #2
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Global Functions, Variables etc. Setup help in excel 2010

    for instance
    Please Login or Register  to view this content.
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  3. #3
    Registered User
    Join Date
    07-27-2012
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Global Functions, Variables etc. Setup help in excel 2010

    THats so helpful, thanks! What does this part do?
    Please Login or Register  to view this content.
    Last edited by Cutter; 07-28-2012 at 10:42 AM. Reason: Added code tags

  4. #4
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Global Functions, Variables etc. Setup help in excel 2010

    it demonstrates how to call the looping sub and pass a different column letter (or number) each time

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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