+ Reply to Thread
Results 1 to 4 of 4

debug error

  1. #1
    Forum Contributor
    Join Date
    05-12-2009
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    219

    debug error

    Hello all expert,

    I have a program in module 2 in attached excel file that help me find some rows in sheet1 and put in sheet2. I'm keep running into run time error eventhough I find nothing wrong with the code. Any input will be greatly appreciated.

    Thanks,
    VB
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    09-27-2011
    Location
    Poland
    MS-Off Ver
    Excel 2007
    Posts
    1,312

    Re: debug error

    Hi your code stop on this line
    If Cells(TopRowCtr, TopLastCol - 1) = Cells(SubRowCtr, SubLastCol - 2) And _
    Cells(TopRowCtr, TopLastCol - 2) = Cells(SubRowCtr, SubLastCol - 1) Then
    when TopLastCol and SubLastCol have value =1 so when You minus 1 or 2 according the code error will appear because there is no cells(7,-1) or cells(7,-2)

    Could you explain what is criteria of searching and copying
    Regards

    tom1977

    If You are satisfied with my solution click the small star icon on the left to say thanks.

  3. #3
    Valued Forum Contributor
    Join Date
    03-14-2012
    Location
    Arizona USA
    MS-Off Ver
    Excel 2000/2007
    Posts
    408

    Re: debug error

    It is not that difficult to debug.

    On the line


    Please Login or Register  to view this content.
    You are setting up the condition so that when "Cells(row,column)" gets evaluated, the column value is either zero(0) or negative. The lowest value allowed is 1.

    I recommend learning some basic debugging skills.
    Last edited by Dennis7849; 03-20-2012 at 05:09 PM.

  4. #4
    Forum Contributor
    Join Date
    05-12-2009
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    219

    Re: debug error

    Thank you all, I was just trying to compare the first number and the last two numbers. If the first numbers are the same and the last two numbers are reversed then put them in sheet2. I've already gotten it figured out.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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