Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Calling sub programs

How do I call subprograms from other programs...and pass information back and forth.

Thanks
chuck
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Calling sub programs

Hi,
Calling sub won't help because sub procedures only carry
out commands, functions on the other return values.

So use something like

Public Function fncStrLen(strData as string) as Long
fncStrLen = Len(strData)
End Function

put the following in your debug window and press return

fncStrLen("abcde")

rsult being 5

regards
KM

For more information double click on Function to highlight
it and press F1 for help.
-----Original Message-----
How do I call subprograms from other programs...and pass

information back and forth.

Thanks
chuck
.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Calling sub programs

You can pass information in the arguments going in both directions if they
are passed byref

Sub Sub1()
myval = 3
othersub myval, someval
msgbox myval & " - " & someval
End sub

Sub Othersub( abc, someval)
abc = abc^abc
someval = "STUV"
End Sub


--
Regards,
Tom Ogilvy


"KM" wrote in message
...
Hi,
Calling sub won't help because sub procedures only carry
out commands, functions on the other return values.

So use something like

Public Function fncStrLen(strData as string) as Long
fncStrLen = Len(strData)
End Function

put the following in your debug window and press return

fncStrLen("abcde")

rsult being 5

regards
KM

For more information double click on Function to highlight
it and press F1 for help.
-----Original Message-----
How do I call subprograms from other programs...and pass

information back and forth.

Thanks
chuck
.



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
Going Between Programs bscuga Excel Discussion (Misc queries) 1 May 6th 08 03:43 PM
Programs not responding PA Bear [MS MVP] Excel Discussion (Misc queries) 3 March 16th 08 02:43 AM
Deleting VBA programs paulrm906 Excel Discussion (Misc queries) 2 December 16th 05 03:59 PM


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