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

I'm trying to pass a string value from one module to
another how can you do this?

I have a string that contains a numerI need to pass that
string to another module to do the rest of the code.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default passing strings

in one module (module1), declare a public varaible (public myVar) .. in the
other module (module2) state module1.myVar = "blahblahblah"

theHman

"Sirron" wrote in message
...
I'm trying to pass a string value from one module to
another how can you do this?

I have a string that contains a numerI need to pass that
string to another module to do the rest of the code.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 459
Default passing strings

I've never used a public variable. Shall I say that again? I've never
used a public variable. If I've never needed one, the chances are you
don't them either. Here's a hint: you should think in terms of passing
values between sub procedures (properties and methods - subs and
functions) not modules.

The closest I've come is a public property Get/Let pair in a class
module, which I would call from outside the class as
InstanceName.PropertyName.

When you use a public variable in a class module VBA implicitly makes
it a public property, technically called a 'field' I believe. You can
explicitly declare property Get/Let pairs in standard modules and get
the implicit behaviour of public variables in standard modules too.

And this is the Module1.MyVar syntax you are referring to i.e. the
equivalent of InstanceName.PropertyName.

But properties in a standard module, implicit or otherwise, don't
really make a lot of sense.

"Josie Dethiers" wrote in message ...
I give almost the same answer to Sirron in another thread ("Passing a string
value") but I used "MyVar" in module2 and not "module1.myVar". Isn't it
required only if the variable has been declared in several modules ?

Josie

"microsoft" a écrit dans le message de news:
...
in one module (module1), declare a public varaible (public myVar) .. in

the
other module (module2) state module1.myVar = "blahblahblah"

theHman

"Sirron" wrote in message
...
I'm trying to pass a string value from one module to
another how can you do this?

I have a string that contains a numerI need to pass that
string to another module to do the rest of the code.



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
find and replace numeric strings in larger text strings Mr Molio Excel Worksheet Functions 8 November 9th 11 05:17 PM
formula for % passing RKing Excel Worksheet Functions 2 August 30th 07 03:32 PM
Passing a row to a function dch3 Excel Worksheet Functions 2 July 31st 06 12:34 PM
How to find number of pairs of strings from list of strings? greg_overholt Excel Worksheet Functions 5 January 27th 06 10:42 PM
How can I count strings within strings Paul W Excel Worksheet Functions 4 June 14th 05 12:39 PM


All times are GMT +1. The time now is 01:16 AM.

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"