+ Reply to Thread
Results 1 to 10 of 10

VBA code error

  1. #1
    Forum Contributor
    Join Date
    02-11-2008
    Location
    India
    MS-Off Ver
    Excel 2013
    Posts
    242

    VBA code error

    Hi,
    I am trying to create this dynamic pivot table but I am getting multiple error,pls help me in debugging it.I am attaching the pivot picture for your persual.

    Please Login or Register  to view this content.
    Attached Images Attached Images
    Attached Files Attached Files
    Last edited by arnab0711; 03-23-2010 at 09:49 AM.

  2. #2
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: VBA code error

    Please put code tags around your code or we can't assist you.
    Ta.
    Remember what the dormouse said
    Feed your head

  3. #3
    Forum Contributor
    Join Date
    02-11-2008
    Location
    India
    MS-Off Ver
    Excel 2013
    Posts
    242

    Re: VBA code error

    Tagged as per forum rules

  4. #4
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: VBA code error

    Hmm, my last post seems to have gone missing.
    Can you post a sample workbook, or at the very least tell us which lines are causing the errors (and what the errors are)? A picture of a pivot table doesn't really help much.

  5. #5
    Forum Contributor
    Join Date
    02-11-2008
    Location
    India
    MS-Off Ver
    Excel 2013
    Posts
    242

    Re: VBA code error

    Hi,
    I am getting Run time Error 1004
    I have also attached the workbook along with the picture

  6. #6
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: VBA code error

    Your worksheet is not called Data, there is no 'logic' field in the table and you need to include the header row in your named range. Then this works:
    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    02-11-2008
    Location
    India
    MS-Off Ver
    Excel 2013
    Posts
    242

    Re: VBA code error

    Hi,
    I tried to do it,but still cannot debug the errors,
    can you provide the correct code that works

  8. #8
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: VBA code error

    That is the correct code that works. Did you make the 3 changes I noted to your workbook?

  9. #9
    Forum Contributor
    Join Date
    02-11-2008
    Location
    India
    MS-Off Ver
    Excel 2013
    Posts
    242

    Re: VBA code error

    Hi,
    I am not getting what do you mean my header row,do you mean to add another row.

  10. #10
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: VBA code error

    Your named range starts from A2 - it needs to start from A1.

+ 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