Excel VBA Run-time error '13': Type mismatch

前端 未结 1 1268
不思量自难忘°
不思量自难忘° 2021-01-21 14:44

I\'m not great at VBA, but all of a sudden, I started getting this error. Please let me know if you can find what the error is. I\'m so stuck on this one. I did search everywher

相关标签:
1条回答
  • 2021-01-21 15:25

    A Run-time error '13': Type mismatch halfway through looping through a large set of values collected from the worksheet is almost always due to encountering a worksheet error code.

    Are there any worksheet error codes (e.g. #N/A, #VALUE!, etc) in either Export!B2:B3500 or Topics!D767:D967 ?

    I found one single #N/A cell. It was not there as an error but as a pasted value :-( It's working now!

    You can quickly locate any worksheet errors in a long column of values (or even an entire worksheet) with these steps.

    1. Select entire column. If you want to look at the whole worksheet, just select any single cell. 2, Tap F5 then click Special.
    2. Choose Formulas and leave only Errors checked.
    3. Click OK.

    Worksheet errors can also be found with one or both of the following.

    <range>.SpecialCells(xlCellTypeConstants, xlErrors)
    <range>.SpecialCells(xlCellTypeFormulas, xlErrors)
    
    0 讨论(0)
提交回复
热议问题