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: 128
Default Correct Syntax for Calling other Subs

Hi All,

What do I need to change in order to get the following to work. Should I be
using a function for this sort of routine?

I get the error "expected function or variable"

Sub TestSub(var1 As Integer)

TestSub = var1 + 2

End Sub

Sub testsub2()
Dim var1

var1 = TestSub(2)
MsgBox var1

End Sub


 
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
Calling subs from different workbooks R.VENKATARAMAN Excel Programming 0 September 26th 04 03:11 PM
Calling VBA add-in functions/subs from another Excel file. Bret Holle Excel Programming 1 September 17th 04 01:43 AM
calling subs Mike Excel Programming 4 April 8th 04 08:22 PM
calling subs, Doesn't seem to run fisrt time? CAA[_21_] Excel Programming 2 April 1st 04 08:23 PM
calling private subs dunlklee Excel Programming 1 December 16th 03 08:40 AM


All times are GMT +1. The time now is 12:21 PM.

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"