+ Reply to Thread
Results 1 to 5 of 5

Run-time error 9: Subscription out of Range explanation needed

  1. #1
    Registered User
    Join Date
    05-07-2013
    Location
    Celje, Slovenia
    MS-Off Ver
    2016, 365
    Posts
    29

    Run-time error 9: Subscription out of Range explanation needed

    Hi!

    Can anybody please explain to me, what does the following part of code do?

    Please Login or Register  to view this content.

    It is a part of a macro that loops through every PivotItem in the PageField (Filter) of the Pivot Table, returns data and copy the data on new sheet for each PivotItem.
    If I don't run the code above, there is no problem - the pivot table is filtered and I get a new sheet for each PivotItem in the PageField. But when I run the code, I get a "Run-time error 9: Subscription out of Range".
    The reason for this error is the line

    Please Login or Register  to view this content.
    So I'd just like to know, what is the purpose of this code and how can I fix it, because I do not have much experience using the codes in Excel.

    Posted also on MrExcel
    Last edited by frankt68; 06-19-2015 at 08:40 AM. Reason: Title change

  2. #2
    Valued Forum Contributor
    Join Date
    03-22-2013
    Location
    Australia,NSW, Wirrimbi
    MS-Off Ver
    Excel 2013
    Posts
    1,057

    Re: Explanation needed

    Hi..

    At a quick glance..

    * You haven't Dimmed or given a value to the z variable.
    * You have commented out the line that is inside your "For x.. Next x" loop

  3. #3
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Explanation needed

    Your post does not comply with Rule 8 of our Forum RULES. Do not crosspost your question on multiple forums without including links here to the other threads on other forums.

    Cross-posting is when you post the same question in other forums on the web. The last thing you want to do is waste people's time working on an issue you have already resolved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser) to the cross-post.

    Expect cross-posted questions without a link to be closed and a message will be posted by the moderator explaining why. We are here to help so help us to help you!

    Read this to understand why we ask you to do this, and then please edit your first post to include links to any and all cross-posts in any other forums (not just this site).

  4. #4
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,606

    Re: Explanation needed

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution.

    Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.

    To change a Title go to your first post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)

  5. #5
    Registered User
    Join Date
    05-07-2013
    Location
    Celje, Slovenia
    MS-Off Ver
    2016, 365
    Posts
    29

    Re: Explanation needed

    Thanks for quick replay...

    Quote Originally Posted by apo View Post
    * You haven't Dimmed or given a value to the z variable.
    As I said it is a part of a code so "z" is dimmed before.


    Quote Originally Posted by apo View Post
    * You have commented out the line that is inside your "For x.. Next x" loop
    If I uncomment it, it gives me the same run-time error 9
    Last edited by frankt68; 06-19-2015 at 08:19 AM.

+ 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] Formula explanation needed
    By alexander.small in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-04-2014, 06:33 AM
  2. Replies: 10
    Last Post: 06-13-2013, 04:12 PM
  3. VBA code explanation needed - Sometimes outputs wrong data
    By Biinge in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-03-2012, 03:33 PM
  4. [SOLVED] Explanation and/or solution needed
    By bunjijumper in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-27-2011, 06:45 AM
  5. Explanation needed for CopyAllModules code
    By davidm in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-13-2005, 06:05 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