LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 709
Default Public Variables

Hi,

I understand the reason for declaring variables, but get fed up with
declaring them for each Sub in each module.

Can I declare my vaiables in 'This Workbook' using public.
Can I also 'publicly' declare what the vaiable refers to so that if I do the
following

Public TodaysDate As String

that I could use

TodaysDate = Worksheets("Dates").range("UpdateToday")
TodaysDate = Format(TodaysDate, "dd-mmm-yy")

in any module/sub.

Unfortunately I have to work with dates that are strings and others that are
dates in various formats.

Thanks for any help / advice

Richard
 
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 [email protected] Excel Programming 1 September 1st 05 04:14 PM
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 12:29 AM.

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

About Us

"It's about Microsoft Excel"