Consulting

Results 1 to 2 of 2

Thread: populating dynamic arrays from a dynamic array

  1. #1

    populating dynamic arrays from a dynamic array

    I have 2 worksheets with very large amounts of data in each. I need to do several different compares against both of them. The first I need to do is create a new workbook of all the records on sheet1 not on sheet2, then those on sheet2 not on sheet1. I have read sheet1 into a dynamic array and sheet2 into another seperate dynaic array. I then am reading thru sheet1 array and looking for the instance of a value (ssn) on sheet2. If not found, I would like to put 3 fields from sheet1 array into a new array call NotFoundArray. I am getting a type mismatch when I try to add the second value to the NotFoundArray.

    ReDim NotFoundArray(NotFoundRecCnt, 3)
    ....

    NotFoundCnt = NotFoundCnt + 1
    NotFoundArray(NotFoundCnt, 1) = TempSSN
    NotFoundArray(NotFoundCnt, 2) = TempName 'name
    NotFoundArray(NotFoundCnt, 3) = "Not found in sheet2" 'message

    I add 1 to NotFoundCnt everytime I have another instance of SSN not found. I get the type mismtach on the 'name line of code.

  2. #2
    as you do not show the types of your variables, can not give a definitive answer
    what type is notfoundcnt?
    what type is tempname?
    try an explicit type conversion to avoid type mismatch
    maybe the array is numeric? therefore can not accept a string

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
  •