Results 1 to 2 of 2
  1. #1
    Star Lounger
    Join Date
    Aug 2001
    Posts
    66
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Type Mismatch (98 MAC)

    Hey all, I'm having a heck of a time making my macro work on both Mac and PC versions of Office.

    Everything works fine on the PC, but one expression (so far) in particular won't evaulate correctly on the darn Mac.

    Dim RankInfo

    RankInfo = Range("A6").Offset(R, C).Formula
    If RankInfo = Spinner.Value Then ....................

    The Macintosh claims that the comparison "If RankInfo = Spinner.Value" is a type mismatch. The Spinner is a SpinButton. I assumed Spinner.Value is then an INTEGER? I tried declaring RankInfo as an Integer and as a Variant but I still get a type mismatch. What gives?

  2. #2
    New Lounger
    Join Date
    Nov 2001
    Location
    Amsterdam
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Type Mismatch (98 MAC)

    Hello

    Perhaps the typeName(varname) function will help here?
    Try msgBox typeName(rankInfo) and see what you get

    Or you can always try
    RankInfo = cInt(Range("A6").Offset(R, C).Formula)

    If you want an Integer

    Cheers

    Mark

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •