+ Reply to Thread
Results 1 to 5 of 5

Index/Match lookup with two columns - Runtime Type 13 Error

  1. #1
    Registered User
    Join Date
    08-21-2013
    Location
    Kelowna, Canada
    MS-Off Ver
    Excel 2010
    Posts
    15

    Index/Match lookup with two columns - Runtime Type 13 Error

    Hi there,

    I am building a timeclock, and am using a user form to allow people to sign in/out.

    I have a punch in form that logs the inputed username and password (after being checked against my employee list), along with a count of their username on this sheet (as a count of how many times they have punched in) and a timestamp (column 4). These values are all pasted to the first blank row in my worksheet "PunchInTimes".

    Then, I have a punch out button that logs these same values the same way, only on "PunchOutTimes". Then, the idea is to link the index number of the PunchOutTimes record and PunchInTimes record for any given user, so that when they punch out, a complete record is pasted (to the first blank row) in a separate worksheet called "Timesheets".

    I have been able to paste the username and count to the "Timesheets" sheet, however as soon as I try to index/match the count and inputed username (on the punch out form), I get an error 13 type mismatch.

    I'm trying to paste the corresponding punch in time to this punch out time, so ive used an index/match with two columns (username and count) found in "PunchInTimes", and try to return the corresponding 4th column value (punch in time). After pasting the "punch out only" values to the PunchOutTimes, i used a "With/End With" statement, and set wsc equal to my 'timesheets' worksheet at the beginning of my code. So the line where I get my error is below in bold:


    Please Login or Register  to view this content.
    Again,

    Everything else works correctly, so "wsc" is defined correctly, the problem has to do with doing a Match formula with 2 columns.

    Any feedback is appreciated,

    Thank you,

    Connor

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Index/Match lookup with two columns - Runtime Type 13 Error

    Do you want to find the last entry for a given user name on sheet PunchInTimes? If yes, try something like this. It uses the .Find Method to retrun the row of the last row of a username in column A

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    08-21-2013
    Location
    Kelowna, Canada
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Index/Match lookup with two columns - Runtime Type 13 Error

    Thank you very much, it worked!

    Any idea why a Match/Index function wouldn't work though?

    I'm just curious.

    Thanks again!

    Connor

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Index/Match lookup with two columns - Runtime Type 13 Error

    Quote Originally Posted by connor12 View Post
    Thank you very much, it worked!

    Any idea why a Match/Index function wouldn't work though?

    I'm just curious.

    Thanks again!

    Connor
    You're welcome.

    This doesn't concatenate the two columns.
    Worksheets("PunchInTimes").Range("A2:A10000") & Worksheets("PunchInTimes").Range("C2:C10000")

  5. #5
    Registered User
    Join Date
    08-21-2013
    Location
    Kelowna, Canada
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Index/Match lookup with two columns - Runtime Type 13 Error

    What would concatenate them?

    I'm just wondering for future reference, because INDEX/MATCH is a handy tool, so I'm trying to figure out the proper way to use it in VBA.

    Thanks again, much appreciated,

    Connor

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Match & Index code results in Runtime error 1004
    By DJvdW in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-27-2013, 03:52 AM
  2. [SOLVED] Runtime error 13 type mismatch when inserting columns
    By ChrisAdl in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-09-2013, 11:27 PM
  3. excel runtime error 13; type miss match
    By terrysoper1973 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 11-01-2012, 12:13 PM
  4. [SOLVED] Only text values matching using index/match lookup - data type pro
    By Stanton in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 PM
  5. [SOLVED] Only text values matching using index/match lookup - data type pro
    By Stanton in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12: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