Results 1 to 3 of 3

Comparing Multiple Columns In 1 Sheet to Columns in Another

Threaded View

  1. #1
    Registered User
    Join Date
    03-14-2018
    Location
    Boston, United States
    MS-Off Ver
    2013
    Posts
    2

    Comparing Multiple Columns In 1 Sheet to Columns in Another

    Hello,

    I am trying to compare columns B through J in in two excel spreadsheets (they are in the same workbook).

    I want column K from the first sheet to display true if every column on the first spreadsheet contains the same numerical value as to every column on the second spreadsheet.

    This is my code:
    Function EQUALVALUES(ParamArray Variance() As Double, ParamArray BV() As Double) As Boolean
        
        'this function compares every in 1 row of cells to every value in another of the same length
        
        Dim i As Integer
     
        For i = LBound(Variance) To UBound(Variance)
            'loop through the cells in the range Variance
            
            If Variance(i) = BV(i) Then
               'Compares the current index of the Variance array to the current index of the BV array
                    
                EQUALVALUES = True
                                
            Else
                
                EQUALVALUES = False
                        
                Exit For
            
            End If
        
        Next i
        
    End Function


    I call the function with =EQUALVALUES(B2:J2, Sheet2!B2:J2)

    I get a #NAME? error when I call the function.

    Is there something wrong with the function or can it just not see the function for some reason?
    Attached Images Attached Images
    Last edited by anonymous12; 03-14-2018 at 10:44 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. VBA Code to compare/match multiple columns in one sheet with multiple columns in another
    By cellsearch123 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-27-2016, 09:25 AM
  2. Comparing a cell in sheet 1 to columns in multiple sheets
    By chrisdua12 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-13-2016, 04:46 PM
  3. Comparing Multiple Columns on 2 sheets and report Exceptions on 3rd Sheet
    By KrystalQ in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-24-2014, 11:41 AM
  4. Replies: 0
    Last Post: 05-20-2013, 11:17 PM
  5. Replies: 2
    Last Post: 03-15-2013, 05:25 PM
  6. Macro to copy 3 columns of data from multiple sheets into 3 columns on 1 sheet
    By bballdcm2007 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-15-2012, 04:37 PM
  7. [SOLVED] comparing multiple columns
    By teejay in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 08-02-2006, 09:05 AM

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