Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Simple VBA Global Delorations?

Hi All

I am trying to write a series of functions in VBA for Excel 97.
I want to declare a series of constants (calculated by trigonometry within
module) at the start of my module for use throughout all the functions.
Can I do this and how?
( I tried to declare them as const but I got an error on the trig
functions.)

Thanks

Chris


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Simple VBA Global Delorations?

A constant is not calculated. You can use a public variable.

Public MyTrigVal1 as Double

Sub InitMyTrigVal1()
MyTrigVal1 = SomeTrigFunction
End Sub

The trick is when do you want InitMyTrigVal1 to be run. Call it from the
workbook_Open event?

See Chip Pearson's page on Events
http://www.cpearson.com/excel/events.htm

--
Regards,
Tom Ogilvy

"Chris" wrote in message
...
Hi All

I am trying to write a series of functions in VBA for Excel 97.
I want to declare a series of constants (calculated by trigonometry within
module) at the start of my module for use throughout all the functions.
Can I do this and how?
( I tried to declare them as const but I got an error on the trig
functions.)

Thanks

Chris




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
global changes Eclaires Excel Worksheet Functions 2 March 17th 08 01:03 PM
IF formula-simple question; simple operator Rich D Excel Discussion (Misc queries) 4 December 6th 07 03:36 PM
Simple problem, simple formula, no FUNCTION ! Ron@Buy Excel Worksheet Functions 6 September 28th 07 04:51 PM
Simple Simple Excel usage question BookerW Excel Discussion (Misc queries) 1 June 23rd 05 10:06 PM
Make it more simple or intuitive to do simple things Vernie Charts and Charting in Excel 1 March 16th 05 04:01 AM


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