Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 86
Default Unreachable public variables

I define a group of public variables. I have a macro that initializes them.
They work fine through all my functions and subs. I have not found a way to
get my formulas in cells to see them. For example =A1*pi won't work. My
workaround has been to stick the value of pi in a cell and use a named range.
What's the real solution to using public vaiables in cell formulas??
--
Gary's Student
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 126
Default Unreachable public variables

Variables are VBA variables and visible only within VBA code. To make
them accessible from XL, create public functions that are then used as
user-defined-functions.' Do keep in mind that XL itself supports many
functions natively, including PI()

Const cPi=3.1415927
public function Pi():pi=cpi:end function

Then, in some cell, use =Pi()


--
Regards,

Tushar Mehta
www.tushar-mehta.com
Multi-disciplinary business expertise
+ Technology skills
= Optimal solution to your business problem
Recipient Microsoft MVP award 2000-2005

In article ,
says...
I define a group of public variables. I have a macro that initializes them.
They work fine through all my functions and subs. I have not found a way to
get my formulas in cells to see them. For example =A1*pi won't work. My
workaround has been to stick the value of pi in a cell and use a named range.
What's the real solution to using public vaiables in cell formulas??

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default Unreachable public variables

Notwithstanding that Excel has a PI() function, if you want worksheet
constants like that, create a workbook name with that name and the required
value.

--
HTH

Bob Phillips

"Gary's Student" wrote in message
...
I define a group of public variables. I have a macro that initializes

them.
They work fine through all my functions and subs. I have not found a way

to
get my formulas in cells to see them. For example =A1*pi won't work. My
workaround has been to stick the value of pi in a cell and use a named

range.
What's the real solution to using public vaiables in cell formulas??
--
Gary's Student



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
public variables johnny Excel Discussion (Misc queries) 7 February 27th 08 03:44 PM
Public variables johnny Excel Discussion (Misc queries) 2 February 24th 08 05:05 AM
Public Variables Jerry McNabb Excel Discussion (Misc queries) 0 February 24th 08 01:26 AM
Public Variables ExcelMonkey[_190_] Excel Programming 5 February 21st 05 10:12 AM
Public Variables Les Gordon Excel Programming 2 November 11th 04 12:29 PM


All times are GMT +1. The time now is 04:16 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"