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

How do I set variables that will remain in scope as long
as my application is open. I need to set several variables
that I need to access (and possibly modify) at any time
after it is initially set while my application is open.

Help here would be greatly appreciated!

Thanks!

Kevin
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Variable Scope

At the top of a standard module outside any procedure

Public Myvar as Variant
Public MyString as String

for example.

then in the workbook_open event in the ThisWorkbook Module

Private Sub workbook_Open()
Myvar = 21
MyString = "Today is " & format(date,"mm/dd/yyyy")

End Sub

--
Regards,
Tom Ogilvy

"Kevin" wrote in message
...
How do I set variables that will remain in scope as long
as my application is open. I need to set several variables
that I need to access (and possibly modify) at any time
after it is initially set while my application is open.

Help here would be greatly appreciated!

Thanks!

Kevin



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
Variable scope TonyM Excel Programming 5 April 24th 04 01:02 PM
Variable scope question w/combo-box, 2ND try Tim Coddington Excel Programming 2 December 20th 03 04:07 AM
Variable scope question w/combo-box Tim Coddington Excel Programming 4 December 17th 03 02:38 AM
Scope of a public variable Jos Vens Excel Programming 0 November 24th 03 10:08 AM
Scope of Public Variable Dkline[_2_] Excel Programming 9 October 22nd 03 04:53 PM


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