+ Reply to Thread
Results 1 to 8 of 8

Debug error in cell.value question

  1. #1
    Registered User
    Join Date
    06-19-2015
    Location
    Michigan
    MS-Off Ver
    2010
    Posts
    30

    Debug error in cell.value question

    Hello,

    I have a problem in a bit of code that I just can't figure out. I need a code to loop through Q7:Q40 and if the value in a cell is 1, change the row color to blue (index 3).

    Please Login or Register  to view this content.
    In this bit of code:
    Please Login or Register  to view this content.
    I keep getting a Run-time error '13': Type Mismatch. I have tried this in many different ways and I keep getting that error for that line.

  2. #2
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Debug error in cell.value question

    Sometimes when I get an error like that I change .Value to . Text (or vice versa) and it corrects the error.
    1N73LL1G3NC3 15 7H3 4B1L17Y 70 4D4P7 70 CH4NG3 - 573PH3N H4WK1NG
    You don't have to add Rep if I have helped you out (but it would be nice), but please mark the thread as SOLVED if your issue is resolved.

    Tom

  3. #3
    Registered User
    Join Date
    06-19-2015
    Location
    Michigan
    MS-Off Ver
    2010
    Posts
    30

    Re: Debug error in cell.value question

    That worked! So strange...

    I wound up changing the code to this:

    Please Login or Register  to view this content.
    Thanks!

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    47,997

    Re: Debug error in cell.value question

    Maybe:

    Please Login or Register  to view this content.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  5. #5
    Forum Expert Debraj Roy's Avatar
    Join Date
    09-27-2012
    Location
    New Delhi,India
    MS-Off Ver
    Excel 2013
    Posts
    1,469

    Re: Debug error in cell.value question

    try something like this..

    Please Login or Register  to view this content.
    Regards!
    =DEC2HEX(3563)

    If you like someone's answer, click the star to give them a reputation point for that answer...

  6. #6
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Debug error in cell.value question

    Glad it worked for you. You might want to give TMS's solution a try as well, he's pretty good at this stuff.

  7. #7
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Debug error in cell.value question

    I can't duplicate the error, but one thing to mention on my machine index 3 is red.

  8. #8
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    47,997

    Re: Debug error in cell.value question

    Could probably do with seeing some sample data (in a sample workbook). I'd especially like to see the expected outcome mocked up.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. VBA Code Runs in Debug Mode But Returns Type Mismatch Error Outside Debug Mode
    By valerie.k.chiang in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-24-2014, 03:48 PM
  2. WHy this debug error
    By maximpinto in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-15-2014, 12:47 AM
  3. Can't debug formula, and a quick array question
    By Chinchin in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-18-2011, 08:28 AM
  4. Debug error 13
    By BillGoodman in forum Excel Programming / VBA / Macros
    Replies: 30
    Last Post: 06-23-2009, 03:12 PM
  5. debug error?
    By mitelkm in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-18-2008, 01:27 PM
  6. Error Won't Debug
    By Trip in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-29-2006, 03:10 PM
  7. [SOLVED] question about debug.print
    By Gary Keramidas in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-28-2005, 09:05 PM
  8. [SOLVED] down with the debug error
    By hurlbut777 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-07-2005, 09:06 PM

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1