Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default How to set global constants and get path of spreadsh ?

Global Constants:
I've VBA functions/subs attached to various
worksheets/modules in a workbook. There are some common
constants (integer/string) among them. Can someone plz
tell me how do I set these constants as global constant
s.t. I can reference the rather then redefining them in
the sheet/module that I need to use ?

Get Path of Spreadsheet:
Can someone please tell me how can I get the current full
path where the spreadsheet is using VB code ?

Thanks for any help.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default How to set global constants and get path of spreadsh ?

Wellie,


1) Declare the constants as Public variables in a standard code
module. E.g.,
Public Const cMyConstant = 1234

2) Use the FullName property. E.g.,
MsgBox ThisWorkbook.FullName


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"wellie" wrote in message
...
Global Constants:
I've VBA functions/subs attached to various
worksheets/modules in a workbook. There are some common
constants (integer/string) among them. Can someone plz
tell me how do I set these constants as global constant
s.t. I can reference the rather then redefining them in
the sheet/module that I need to use ?

Get Path of Spreadsheet:
Can someone please tell me how can I get the current full
path where the spreadsheet is using VB code ?

Thanks for any 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 I display a hyperlink from one spreadsheet on another spreadsh demarchi Excel Worksheet Functions 0 November 18th 08 04:48 PM
I am having some trouble with a long formula and multiple spreadsh LiveUser Excel Worksheet Functions 6 July 2nd 08 09:28 PM
why does the page number appear in the middle of my excel spreadsh csgilmore Excel Discussion (Misc queries) 2 May 14th 07 12:29 AM
hyperlink navigation path path wrong in Excel 2003 CE Admin Excel Discussion (Misc queries) 5 January 7th 06 07:47 PM
How can I use a JPEG watermark as background in an excel spreadsh. TerraTech Excel Discussion (Misc queries) 1 February 15th 05 01:11 PM


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