Results 1 to 2 of 2

Cannot call function VBA in excel 2010. Please help me.

Threaded View

  1. #1
    Registered User
    Join Date
    10-14-2012
    Location
    Ho Chi Minh, Viet Nam
    MS-Off Ver
    Excel 2010
    Posts
    1

    Cannot call function VBA in excel 2010. Please help me.

    result.jpgI have a function to calculate following :
    Function FindValue(rng1 As Range, rng2 As Range, rng3 As Range, index As Integer) As String
        Dim value As String
        Dim n, i As Integer
        Dim count As Integer
        
        value = ""
        count = 0
        
        n = rng1.count
        
        For i = 1 To n
            If Application.WorksheetFunction.CountIf(rng2, rng1(i)) > 0 And Application.WorksheetFunction.CountIf(rng3, rng1(i)) = 0 Then
                count = count + 1
                If count = index Then
                    value = rng1(i)
                    Exit For
                End If
            End If
        Next
        
        FindValue = value
    End Function

    When I export output excel then I have result follow (imageerror.jpg) :
    I have double click on cells have string "######" and press enter then the result appear.
    I want to result appear when file open.
    Please help me.Thanks so much
    Last edited by arlu1201; 03-07-2013 at 04:13 AM. Reason: Use code tags.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1