Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
HOW TO CARRY A VAIABLE RESULTS FROM EXCEL SHEET PROCEDURE TO A MODULE
DEAR ALL
What I need is asf: In worksheet procedure (procedure resides in microsoft excel objects) using a command button click one result is obtained say total cargo figures and the variable name is - cgofigs-. I want this variable -cgofigs- to be taken to standard module to carryout other calculations using this variable -cgofigs- result. Pls advice how to call this -cgofigs- variable from excel sheets procedure into the modules? |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
HOW TO CARRY A VAIABLE RESULTS FROM EXCEL SHEET PROCEDURE TO A MODULE
One way to do it is to assign the value to a named range, which will
maintain the value even when other routines have ended (and hence would not be able to carry the value on to other routines). Add this line to the code that determines the value: Names("nrCgoFigs").Value = cgofigs Other routines can then refer to Names("nrCgoFigs").Value. Dave O |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
HOW TO CARRY A VAIABLE RESULTS FROM EXCEL SHEET PROCEDURE TO A MODULE
On Feb 2, 11:33 pm, "Dave O" wrote:
One way to do it is to assign the value to a named range, which will maintain the value even when other routines have ended (and hence would not be able to carry the value on to other routines). Add this line to the code that determines the value: Names("nrCgoFigs").Value = cgofigs Other routines can then refer to Names("nrCgoFigs").Value. Dave O D/DAVE Thnks fr quick response. At present I am doing like that -- assigning it to one of the cells and calling it. But for knowledge sake i want to know how to do it thro calling that variable from excell sheet procedure into module procedure. Pls adv |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
HOW TO CARRY A VAIABLE RESULTS FROM EXCEL SHEET PROCEDURE TO A MODULE
Routines can pass public variables back and forth but only when all
the routines in question are running. That's why the named range technique works- because the value persists in memory even when the routine that generates it has ended. If the value of cgofigs is written to a cell or is the result of a formula in a cell, a routine can refer to the value of that cell: Range("'sheet1'!b2").Value |
#5
Posted to microsoft.public.excel.misc
|
|||
|
|||
HOW TO CARRY A VAIABLE RESULTS FROM EXCEL SHEET PROCEDURE TO A MODULE
On Feb 3, 12:07 am, "Dave O" wrote:
Routines can pass public variables back and forth but only when all the routines in question are running. That's why the named range technique works- because the value persists in memory even when the routine that generates it has ended. If the value of cgofigs is written to a cell or is the result of a formula in a cell, a routine can refer to the value of that cell: Range("'sheet1'!b2").Value D/DAVE Thank you and I got better solution than i asked for. I tried your sugestion and it is great. I did it the way u sugested but confirm my steps right or not. In the activesheet i assigened a cell and given it the name nrCgoFigs. And in the code i hv added what u sugested. Names("nrCgoFigs").Value = cgofigs . |
#6
Posted to microsoft.public.excel.misc
|
|||
|
|||
HOW TO CARRY A VAIABLE RESULTS FROM EXCEL SHEET PROCEDURE TO A MODULE
Glad to help!
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
can't paste in excel without having an open excel sheet! | Excel Discussion (Misc queries) | |||
Named Ranges | Excel Worksheet Functions | |||
Combining data from cells from several excel sheets to a new sheet | Excel Discussion (Misc queries) | |||
Does excel recognise names rather than cells? | Excel Worksheet Functions | |||
Hyperlink to specific sheet in Excel Web File | Links and Linking in Excel |