+ Reply to Thread
Results 1 to 5 of 5

My code returns no errors but seems to be skipping a line

  1. #1
    Registered User
    Join Date
    12-27-2018
    Location
    Bogota, Colombia
    MS-Off Ver
    Excel 2013, 2016
    Posts
    25

    My code returns no errors but seems to be skipping a line

    Hi all, I've got the following code:

    Please Login or Register  to view this content.
    as part of a for/next loop that calls on a function repeatedly. The only thing is that the whole If/Then section of the code gets skipped starting at

    Please Login or Register  to view this content.
    Meaning that I'm probably not setting the results of the function well as the variable Altura

    The code for the function is below.

    Please Login or Register  to view this content.
    Any pointers as to what I'm doing wrong here? It almost definitely has something to do with either the variable or the result of the function being an error.

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,613

    Re: My code returns no errors but seems to be skipping a line

    seems you never reach such situation where
    Please Login or Register  to view this content.
    to debug the code you may use Debug -> Step into (F8) or Debug->Set Berakpoints (F9) and observe values of your variables in Locals window (if it's not visible, use View->Locals)
    Best Regards,

    Kaper

  3. #3
    Registered User
    Join Date
    12-27-2018
    Location
    Bogota, Colombia
    MS-Off Ver
    Excel 2013, 2016
    Posts
    25

    Re: My code returns no errors but seems to be skipping a line

    Hi Kaper, thanks for the reply. Sorry for never noticing, I thought this thread had just been abandoned.

    Thanks for the tip on the locals window, that's a function that I never knew existed. I think I figured out what happened. I'm not setting the range variable correctly. When I try it tells me that no cells were found, so it seems to be happening in this area before even calling the function, which I neglected to include before in the name of simplicity.

    Please Login or Register  to view this content.
    Any idea what might be wrong here?
    Incidentally Seguimiento is a Worksheet variable.

  4. #4
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,613

    Re: My code returns no errors but seems to be skipping a line

    From the code, in Rango variable you shall have stored a range which is equivalent to:
    making active sheet Seguimiento
    selecting A6:L6 row
    Pressing Ctrl+Down

  5. #5
    Registered User
    Join Date
    12-27-2018
    Location
    Bogota, Colombia
    MS-Off Ver
    Excel 2013, 2016
    Posts
    25

    Re: My code returns no errors but seems to be skipping a line

    Yeah, I ended up replacing it with something that doesn't use selections. That part works now. Thanks for the help!

+ 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. [SOLVED] Skipping Blanks and Errors
    By Sthlm in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-28-2019, 08:30 AM
  2. [SOLVED] Bar Chart for Dates/Dollars skipping errors
    By Grizraz in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 04-20-2019, 11:31 PM
  3. sum text boxes and skipping errors
    By esaban in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-29-2014, 09:40 AM
  4. Skipping Over SolverSolve Line of Code
    By SDruley in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-14-2010, 04:34 PM
  5. Skipping Visual Basic macro errors
    By KevinThomas in forum Excel General
    Replies: 1
    Last Post: 06-29-2009, 03:29 AM
  6. Filter code skipping a line
    By jad70 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-07-2009, 04:54 AM

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