Results 1 to 2 of 2

Thread: How to Use ParamArray (Ratio Function)

  1. #1
    Member Rajan_Verma's Avatar
    Join Date
    Sep 2011
    Posts
    81
    Rep Power
    13

    Lightbulb How to Use ParamArray (Ratio Function)

    Param array is the collection of variant type variable : its allow to pass Voluntarily Variable to a Function, See the Below Mention Ratio Function, We can give any number of Arguments to this Function and can get Ratio:


    Code:
    Function Ratio(ParamArray arr()) As String
            For i = 0 To UBound(arr)
                Ratio = Ratio & arr(i) / WorksheetFunction.Gcd(arr) & ":"
            Next
            Ratio = Left(Ratio, Len(Ratio) - 1)
    End Function
    Last edited by Rajan_Verma; 03-27-2012 at 02:47 PM.

  2. #2
    Member littleiitin's Avatar
    Join Date
    Aug 2011
    Posts
    90
    Rep Power
    13
    Nice stuff

Similar Threads

  1. UDF (user defined function) replacement for Excel's DATEDIF function
    By Rick Rothstein in forum Rick Rothstein's Corner
    Replies: 21
    Last Post: 03-07-2015, 09:47 PM
  2. Replies: 5
    Last Post: 05-28-2013, 03:00 AM
  3. Calculating Ratio Within Groups using Self Join
    By Transformer in forum Tips, Tricks & Downloads (No Questions)
    Replies: 0
    Last Post: 05-21-2013, 07:52 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •