+ Reply to Thread
Results 1 to 10 of 10

Why is this code breaking...

  1. #1
    Forum Contributor
    Join Date
    09-09-2013
    Location
    California, USA
    MS-Off Ver
    MS 365 Subscription
    Posts
    130

    Why is this code breaking...

    I have a code that searches in a column for a value and deletes three lines if the value matches. And the code will continue based on the last value in another column. I switched up a few parameters in the code and now it's breaking. Can someone help explain why?

    Please Login or Register  to view this content.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Why is this code breaking...

    Works fine for me.

    I would use .End(xlUp) instead of .End(3)
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Expert
    Join Date
    08-02-2013
    Location
    Québec
    MS-Off Ver
    Excel 2003, 2007, 2013
    Posts
    1,412

    Re: Why is this code breaking...

    It works fine with me too.
    You didn't the specify the worksheet so I'm assuming that you run your code on the activesheet.
    GC Excel

    If this post helps, then click the star icon (*) in the bottom left-hand corner of my post to Add reputation.

  4. #4
    Forum Contributor
    Join Date
    09-09-2013
    Location
    California, USA
    MS-Off Ver
    MS 365 Subscription
    Posts
    130

    Re: Why is this code breaking...

    Quote Originally Posted by shg View Post
    Works fine for me.

    I would use .End(xlUp) instead of .End(3)
    Well every so often in all my data there is a footer that will have "Continued" in it. So I'm looking for that value and then deleting that row and the next two rows in addition. The code works fine for me when it was looking for continued in column G:
    Please Login or Register  to view this content.
    But When I changed it to look for "Continued" in column F it breaks right here:
    Please Login or Register  to view this content.

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Why is this code breaking...

    What does "breaks" mean?

  6. #6
    Forum Contributor
    Join Date
    09-09-2013
    Location
    California, USA
    MS-Off Ver
    MS 365 Subscription
    Posts
    130

    Re: Why is this code breaking...

    Quote Originally Posted by shg View Post
    What does "breaks" mean?
    I get a Run-time error '13': Type mismatch

  7. #7
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Why is this code breaking...

    What was in the cell?

    NVM that. Post a workbook that illustrates the problem.

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

    Re: Why is this code breaking...

    Does it break with this modification?

    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    09-09-2013
    Location
    California, USA
    MS-Off Ver
    MS 365 Subscription
    Posts
    130

    Re: Why is this code breaking...

    Quote Originally Posted by JOHN H. DAVIS View Post
    Does it break with this modification?

    Please Login or Register  to view this content.
    No it breaks with this modification:

    Please Login or Register  to view this content.
    It works fine in column G, but not when I change it to column F.

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

    Re: Why is this code breaking...

    Can you attach a sample file which produces the error? Myself I can only guess at this point, but I think I may see something which would cause it.

+ 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. Code breaking at one line
    By concatch in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 05-25-2012, 08:19 AM
  2. Breaking Out State Code
    By NFJim in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-20-2009, 12:05 PM
  3. Breaking down a code......
    By p3te2 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-25-2007, 05:47 AM
  4. [SOLVED] Breaking password on VB Code
    By Barb Reinhardt in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-05-2006, 12:15 PM
  5. Code Breaking
    By dok112 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-17-2006, 04:30 PM

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