ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   really basic (pardon the pun) problems (https://www.excelbanter.com/excel-programming/353228-really-basic-pardon-pun-problems.html)

[email protected]

really basic (pardon the pun) 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




Toppers

really basic (pardon the pun) problems
 
Hi,
Declare the variables in a general module - which is where you
should put your macros (unless they are associated with a userform or an
event) as below. When you open a general module you will see the caption
(Declarations) in the top right "drop down" - type in the declarations of the
Public variables. When completed i.e. when first SUB statement is encountered
a line will appear between the declarations and the macro.

HTH

Public myvar As String <=== Declare these first then add your macro(s)
Public thisvar as integer

Sub mysub1()

End Sub

Sub Mysub2

End sub
" wrote:

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





Norman Jones

really basic (pardon the pun) problems
 
Hi The MangoStays,

See also responses to your post in the Excel group.


---
Regards,
Norman



wrote in message
oups.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







All times are GMT +1. The time now is 06:07 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com