logo elektroda
logo elektroda
X
logo elektroda

VBA Excel Macro: Type Mismatch Runtime Error 13 - Resolving Issues in Do Until Line

bursonik 5478 4
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 16493046
    bursonik
    Level 8  
    Hi, I have a macro like this:
    Code: VB.net
    Log in, to see the code


    When using the error, Type mismatch runtime error 13 pops up and points to the line:
    Code: VB.net
    Log in, to see the code


    How to solve this problem?

    Thank you in advance for your help.
  • ADVERTISEMENT
  • #2 16494690
    kinggustav
    Level 27  
    I suggest you start by adding parentheses so that everything counts the way you want it, not the default. I know sometimes because of this (prioritization) there are all sorts of strange effects.
  • ADVERTISEMENT
  • #3 16494727
    JRV
    VBA, Excel specialist
    Better to add an attachment (runtime error 13 - different data types)
  • ADVERTISEMENT
  • Helpful post
    #4 16497118
    lanzul
    Level 30  
    bursonik wrote:
    ... When I use the error Type mismatch runtime error 13 appears and points to the line:
    Code: VB.net
    Log in, to see the code

    How to solve this problem?


    ... :) enter the correct construction for:
    Code: VBScript
    Log in, to see the code

    because this syntax refers to an object ' Selection ', not to the contents of the cell designated by this selection, and equal to " TOTAL COST OF STATE * ", e.g .:
    Code: VBScript
    Log in, to see the code
  • #5 16509818
    bursonik
    Level 8  
    thanks, it works!
ADVERTISEMENT