Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 115
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 427
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 115
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 427
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 115
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 427
Default HOW TO CARRY A VAIABLE RESULTS FROM EXCEL SHEET PROCEDURE TO A MODULE

Glad to help!

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
can't paste in excel without having an open excel sheet! troy stud Excel Discussion (Misc queries) 3 October 27th 06 11:46 PM
Named Ranges Epinn Excel Worksheet Functions 23 October 16th 06 07:27 AM
Combining data from cells from several excel sheets to a new sheet Rik Excel Discussion (Misc queries) 4 February 22nd 06 10:16 AM
Does excel recognise names rather than cells? Sue Excel Worksheet Functions 9 May 22nd 05 04:51 AM
Hyperlink to specific sheet in Excel Web File jd17 Links and Linking in Excel 0 December 8th 04 10:03 PM


All times are GMT +1. The time now is 12:05 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"