+ Reply to Thread
Results 1 to 9 of 9

While Using Value from Range D3:D in String, if (D, x) = "" doesnt skip to next row??

  1. #1
    Registered User
    Join Date
    10-14-2011
    Location
    chesapeake, va
    MS-Off Ver
    Excel 2007
    Posts
    59

    While Using Value from Range D3:D in String, if (D, x) = "" doesnt skip to next row??

    In my Workbook Code, Sub Get_MovieData(), its using A:A to discover last row, Using the Number From Each in in column D, it then Pulls Data from a Web XML doc and filles in the rest of the Row with Data. it should then goto the Next row and use the Data from column D, however if column D is Empty, it scips to the Next Row, Makes the querry, but doesn't skip to the next row to add the Data, leaving the Data incorrect

    heres The Code:
    Please Login or Register  to view this content.
    WorkBookMovies.xlsm... Working With Sheets("Movies")
    Last edited by Spyderz; 10-28-2012 at 02:00 PM.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,651

    Re: While Using Value from Range D3:D in String, if (D, x) = "" doesnt skip to next row??

    Put Set rng = rng.Offset(1) after End If and before Next j so the row offsets for each j regardless if D is empty.

    Please Login or Register  to view this content.
    Alternatively, offset the column .Values from rngCode as that is the current column D cell.

  3. #3
    Registered User
    Join Date
    10-14-2011
    Location
    chesapeake, va
    MS-Off Ver
    Excel 2007
    Posts
    59

    Re: While Using Value from Range D3:D in String, if (D, x) = "" doesnt skip to next row??

    I thought that was where the error was coming from.. apparently didn't move it to the right place. Thanks again.

    I'm running into another problem, if you have a moment. i keep running into an object variable, or with block variable not defined error.. doesn't give me a debug option though, so i have no idea where to look.. but it happens with the same bit of code as above at row 184 column M.. I'm not sure how to get it to just get past the error.

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,651

    Re: While Using Value from Range D3:D in String, if (D, x) = "" doesnt skip to next row??

    This line fills column M

    rng.Offset(0, 12).Value = nodes(nd + 1).Attributes(1).Value

    My guess is that nodes(nd + 1).Attributes(1).Value doesn't evaluate for a specific movie for some reason. I cannot say why without seeing the web page.

  5. #5
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: While Using Value from Range D3:D in String, if (D, x) = "" doesnt skip to next row??

    Check the length of the attributes collection.

  6. #6
    Registered User
    Join Date
    10-14-2011
    Location
    chesapeake, va
    MS-Off Ver
    Excel 2007
    Posts
    59

    Re: While Using Value from Range D3:D in String, if (D, x) = "" doesnt skip to next row??

    That's exactly the Line, that portion is supposed to pull the image link, and i looked that page it was searching, and it became very apparent why it errored out, theres no <Images attribute
    what would you suggest to skip that bit of code, or add a blank value for the time being?

    heres the site:
    HTML Code: 

  7. #7
    Registered User
    Join Date
    10-14-2011
    Location
    chesapeake, va
    MS-Off Ver
    Excel 2007
    Posts
    59

    Re: While Using Value from Range D3:D in String, if (D, x) = "" doesnt skip to next row??

    such as if nodes.length < 0

    ok i think i'm following now
    Please Login or Register  to view this content.
    Like on every one of the other Attibute searches
    Last edited by Spyderz; 10-28-2012 at 01:23 PM.

  8. #8
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: While Using Value from Range D3:D in String, if (D, x) = "" doesnt skip to next row??

    Check if there are any nodes, as you've done here for category.
    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    10-14-2011
    Location
    chesapeake, va
    MS-Off Ver
    Excel 2007
    Posts
    59

    Re: While Using Value from Range D3:D in String, if (D, x) = "" doesnt skip to next row??

    Thanks For the help, that fixed it completely. I'm already working on if Data present, goto next cell, as to speed up the whole process.. kinda kicking my butt, but I'm certain I'll figure it out, thanks Again

+ 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