Notices
Non Scooby Related Anything Non-Scooby related

visual basic question (easy one)

Thread Tools
 
Search this Thread
 
Old 04 October 2001, 11:05 PM
  #1  
airhead
Scooby Regular
Thread Starter
 
airhead's Avatar
 
Join Date: Oct 2000
Posts: 184
Likes: 0
Received 0 Likes on 0 Posts
Question

very easy if you know the command/syntax

I have a variable v inside macro1. Macro1 uses (ie calls) macro3 which also uses the same variable v. I can't get macro3 to reflect the true value of v as determined from macro1.

I beleive it's something to do with public/private declaration ?

Q1 - is there an easy command in macro3 that takes the value for v from macro1 ?
something like v = v["macro1"]()

Q2 If not, what's the public/private declaration, where does it go, and what's the correct syntax.

Q3 What if there is a macro2 between macro1 and 3. (ie macro1 calls macro2, which calls macro3)
Does this complicate matters in terms of commands/syntax etc.

Non technical answers please as am not in IT.

Thanks, airhead
Old 04 October 2001, 11:57 PM
  #2  
ChrisB
Moderator
 
ChrisB's Avatar
 
Join Date: Dec 1998
Location: Staffs
Posts: 23,573
Likes: 0
Received 0 Likes on 0 Posts
Post

Hmm, I tried to reply to Blubs thread and it ends up in here? Pfff!

[This message has been edited by ChrisB (edited 04 October 2001).]
Old 06 October 2001, 01:28 AM
  #3  
DemonDave
Scooby Regular
iTrader: (13)
 
DemonDave's Avatar
 
Join Date: Jan 2001
Location: Midlands - between notts and derby !
Posts: 4,997
Likes: 0
Received 0 Likes on 0 Posts
Post

You dont say which app. But under the general declartions section when you use the visual basic editor. For the module which shares macro 1 and macro 3 then put

Dim v As Integer

in and this will make v available to both macros.

Dave
Old 08 October 2001, 08:02 AM
  #4  
airhead
Scooby Regular
Thread Starter
 
airhead's Avatar
 
Join Date: Oct 2000
Posts: 184
Likes: 0
Received 0 Likes on 0 Posts
Cool

it was vb for excel.

Thanks for that. Yes, doing the dim statement as stated does work.

I live and learn ! Simple when you know how.

Ta.
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
KAS35RSTI
Subaru
27
04 November 2021 07:12 PM
Frizzle-Dee
Essex Subaru Owners Club
13
01 December 2015 09:37 AM
Brzoza
Engine Management and ECU Remapping
1
02 October 2015 05:26 PM
Davalar
General Technical
19
30 September 2015 08:54 PM
Pro-Line Motorsport
Car Parts For Sale
2
29 September 2015 07:36 PM



Quick Reply: visual basic question (easy one)



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