+ Reply to Thread
Results 1 to 3 of 3

really basic problems

Hybrid View

Guest really basic problems 02-14-2006, 05:10 AM
Guest Re: really basic problems 02-14-2006, 05:20 AM
Guest Re: really basic problems 02-14-2006, 05:25 AM
  1. #1
    themangostays@gmail.com
    Guest

    really basic problems

    hi,

    Call me dumb, but I've written a simple excel VBA macro that pulls the
    values of various cells from various sheets on a simple invoicing
    package i'm working on. One of the sheets is a reference sheet
    containing client and job specific data. This sheet is then referenced
    against the financial data sheet.
    Why oh why can't I declair public variables that can be transfered
    between forms/sheets.
    I've tried everything. Can one of you clever folk tell me:

    1. where should I be storing these procedures. In individual modules,
    behind sheets or behind forms

    2. how do I get the variables to be passed between the above

    3. Where should i be declairing these variables. The're (yes you
    guessed it) simple. Just cash values and strings.

    Please help

    Cheers

    themangostays@gmail.com


  2. #2
    Bob Phillips
    Guest

    Re: really basic problems



    <themangostays@gmail.com> wrote in message
    news:1139907541.128741.154330@g47g2000cwa.googlegroups.com...
    > hi,
    >
    > Call me dumb, but I've written a simple excel VBA macro that pulls the
    > values of various cells from various sheets on a simple invoicing
    > package i'm working on. One of the sheets is a reference sheet
    > containing client and job specific data. This sheet is then referenced
    > against the financial data sheet.
    > Why oh why can't I declair public variables that can be transfered
    > between forms/sheets.
    > I've tried everything. Can one of you clever folk tell me:
    >
    > 1. where should I be storing these procedures. In individual modules,
    > behind sheets or behind forms


    If being used in multiple modules, store them in a standard code module.

    > 2. how do I get the variables to be passed between the above


    Just reference them b y variable name, by being public in a standard code
    module, they will be accessible.

    > 3. Where should i be declairing these variables. The're (yes you
    > guessed it) simple. Just cash values and strings.


    At the start of the module, outside of any procedure.



  3. #3
    Norman Jones
    Guest

    Re: really basic problems

    Hi TheMangoStays,

    > 1. where should I be storing these procedures. In individual modules,
    > behind sheets or behind forms


    Worksheet event code should be placed in the worksheet's sheet module;
    Userform code should bbe placed in the userformn's code module. Otherwise
    procedures would normally resise in a standard workbook module.

    For a comprehensive treatment of this issue, see Chip Pearson at:

    http://www.cpearson.com/excel/codemods.htm


    > 2. how do I get the variables to be passed between the above
    > 3. Where should i be declairing these variables. The're (yes you
    > guessed it) simple. Just cash values and strings.



    Try declaring these variables as Public (global) variables at the top of a
    standard module. Set the variable value in one sub and read the value in
    another sub. Note that, having declared these variables at module level, the
    should not be declared in the sub procedure code.

    You may additionally find Chip Pearson's comments on variable declaration
    instructive:

    http://www.cpearson.com/excel/variables.htm


    ---
    Regards,
    Norman


    <themangostays@gmail.com> wrote in message
    news:1139907541.128741.154330@g47g2000cwa.googlegroups.com...
    > hi,
    >
    > Call me dumb, but I've written a simple excel VBA macro that pulls the
    > values of various cells from various sheets on a simple invoicing
    > package i'm working on. One of the sheets is a reference sheet
    > containing client and job specific data. This sheet is then referenced
    > against the financial data sheet.
    > Why oh why can't I declair public variables that can be transfered
    > between forms/sheets.
    > I've tried everything. Can one of you clever folk tell me:
    >
    > 1. where should I be storing these procedures. In individual modules,
    > behind sheets or behind forms
    >
    > 2. how do I get the variables to be passed between the above
    >
    > 3. Where should i be declairing these variables. The're (yes you
    > guessed it) simple. Just cash values and strings.
    >
    > Please help
    >
    > Cheers
    >
    > themangostays@gmail.com
    >




+ 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