+ Reply to Thread
Results 1 to 10 of 10

NextRow VBA giving strange result...

  1. #1
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    NextRow VBA giving strange result...

    Hi All

    Perhaps I'm losing my mind here but for the life of me I can't figure out why this code is giving me the nextrow as 47 and not 2.
    Please help me understand!!!!
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: NextRow VBA giving strange result...

    Rows1 to 47 are not blanks. They may appear blanks to your eyes, but not to VBA.
    Follow these steps to prove they are not blanks.
    Put the cursor in A1, or A2

    CRTL+G
    Go to window
    Choose Special
    Then choose blank
    You then see rows 1- 47 are not highlighted as blanks

  3. #3
    Valued Forum Contributor ImranBhatti's Avatar
    Join Date
    03-27-2014
    Location
    Rawalpindi,Pakistan
    MS-Off Ver
    Office 365
    Posts
    1,784

    Re: NextRow VBA giving strange result...

    By pressing Ctrl + End it takes to 154 I think.
    Delete the rows from 2 to 10448576 then it will return 2
    Teach me Excel VBA

  4. #4
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: NextRow VBA giving strange result...

    That really confuses me AB33

    Please tell me how this happened and how to correct it.

  5. #5
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: NextRow VBA giving strange result...

    @ ImramBhatti

    thanks solved.....What however made those rows not be blanks I wonder

  6. #6
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: NextRow VBA giving strange result...

    The "blanks" were probably empty strings ("") returned by formulas, which were copied and then pasted as values. This will fix it:
    Please Login or Register  to view this content.
    If you use a variant to move data, instead of copy/paste, you can avoid the problem. But copy/paste is faster for large amounts of data.
    Last edited by leelnich; 05-10-2017 at 06:32 AM.

  7. #7
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: NextRow VBA giving strange result...

    You have non-printable characters

    You either delete the rows or clean them. If you use clean function, it removes all non-visible and non-printable characters.

  8. #8
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: NextRow VBA giving strange result...

    hanks all for your valuable inputs.

  9. #9
    Valued Forum Contributor ImranBhatti's Avatar
    Join Date
    03-27-2014
    Location
    Rawalpindi,Pakistan
    MS-Off Ver
    Office 365
    Posts
    1,784

    Re: NextRow VBA giving strange result...

    You are welcome Sintek.
    And thanks for the rep...

  10. #10
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: NextRow VBA giving strange result...

    Happy to help, and thanks. -Lee

+ 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. Countif formula giving strange outcome
    By BAVE in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-01-2013, 06:11 AM
  2. [SOLVED] Simple =Sum(B2:L2) result is not giving accurate result and =IMSUM(M2,O2) also.
    By SimonsGE in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-29-2013, 01:56 AM
  3. XIRR giving strange answers
    By jd354 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-07-2013, 10:50 PM
  4. Formula giving different result on two different pcs
    By mdooley in forum Excel General
    Replies: 2
    Last Post: 05-28-2012, 07:05 PM
  5. vlookup / if statement giving strange values
    By zazzz in forum Excel General
    Replies: 5
    Last Post: 08-15-2011, 11:46 AM
  6. Macro worked for 2 years, suddenly started giving strange results
    By dylanemcgregor in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-21-2009, 04:39 AM
  7. Strange MOD() result?
    By rwgrietveld in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-11-2008, 11:02 AM
  8. VBA chart: scale giving strange months
    By steve@work in forum Excel Charting & Pivots
    Replies: 6
    Last Post: 11-07-2007, 11:20 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