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: 245
Default Passing Paramiters and UDF Question

Greetings, I have a function that adds two ranges then subtracts Range B from
Range A giving me "N" I would like to know how to modify the following to be
able to pass N back into a sub procedure on a userform.

Function GetBalances()
Dim x As Long, y As Long, N As Long
Dim ARange As Range, BRange As Range

Set ARange = Range("A:A")
Set BRange = Range("B:B")

x = WorksheetFunction.Sum(ARange)
y = WorksheetFunction.Sum(BRange)
N = x - y
Debug.Print N
End Function

 
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
General Question regarding passing cells, ranges, cell values through subs & functions [email protected] Excel Programming 2 September 5th 04 06:03 AM
General Question regarding passing cells, ranges, cell values through subs & functions [email protected] Excel Programming 1 September 5th 04 12:57 AM
General Question regarding passing cells, ranges, cell values through subs & functions [email protected] Excel Programming 1 September 4th 04 10:40 PM
General Question regarding passing cells, ranges, cell values through subs & functions [email protected] Excel Programming 1 September 4th 04 09:09 PM
Question: Macro overloading, passing variable number of arguments Frederik Romanov Excel Programming 1 July 8th 03 02:51 PM


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