Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
problems with excel and visual basic for applications | Excel Discussion (Misc queries) | |||
Basic bar graphs using rept function - Printing problems | Excel Worksheet Functions | |||
Problems in Visual Basic Editior, In search of a command | Excel Programming | |||
Any Visual Basic Users Having Mouse Scrolling Problems? | Excel Programming | |||
A few problems Programming to the Visual Basic Editor | Excel Programming |