Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default private variable: same module, other Sub/Function

That was the problem, now it works.
Thanks,
Stefi


Snake Plissken ezt *rta:

I suggest to declare variables before subs as follows

option explicit

dim var1, var2 as string
dim var3, var5 as integer
dim var4 as long
etc.

sub name_of_sub_1 ()
var1= "anystring"
.......
end sub

sub name_of_sub_2()
var3= 5
var5= 6
......
end sub

Function name_of_f(...)
'here u can "read" value of variables from subs and perform a function
end function

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
Private Sub - Only Accessible from same Module? pallaver Excel Discussion (Misc queries) 1 July 8th 08 02:57 PM
STATIC VARIABLE NOT AVAILABLE IN ANOTHER MODULE CAPTGNVR Excel Discussion (Misc queries) 2 February 1st 07 07:30 PM
Initialize a Private variable jerry chapman[_2_] Excel Programming 5 February 21st 05 11:41 PM
Call Private Function from ThisWorkbook module Beto[_3_] Excel Programming 3 February 25th 04 01:36 PM
Variable from a sheet module in a class module in XL XP hglamy[_2_] Excel Programming 2 October 14th 03 05:48 PM


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