Results 1 to 7 of 7

Thread: troubles working with double

Threaded View

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 2021
    Posts
    39

    Unhappy troubles working with double

    hello guys i'm trying to compare two columns but the problem is that when the value is double i can't compare it;
    if the value is string then i can work normal with it but if it's double the programme stop working telling me that it had problems converting double to object can you please suggest me how to solve this problem.

    in my columns i have values like cell 1 :2235
    cell2 2685
    cell 3 D2568
    cell 4 E695
    cell 5 3256

    so i can't compare the value that is double to a value that is string
    P.S i only added the part of the program where the problem is .


    Code:
       Dim findme1 As Excel.Range = ws1.Range("A4:A" & Range1.Rows.Count)
                Dim findme2 As Excel.Range = ws2.Range("F5:F" & Range2.Rows.Count)
                Dim MyArray As Object(,) = CType(findme1.Value, Object(,))
                Dim MyArrayy As Object(,) = CType(findme2.Value, Object(,))
    for n=1 to MyArray.length
    for m=1 to MyArrayy.length
    if MyArray(n,1)=MyArrayy(m,1) then  ' can't convert string to doubt
    ....
    end if 
    next m
    next n
    Last edited by highfly884; Oct 6th, 2021 at 09:21 AM.

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
  •  



Click Here to Expand Forum to Full Width