+ Reply to Thread
Results 1 to 17 of 17

Help on VBA to select all column dates into pivot fields

  1. #1
    Forum Contributor
    Join Date
    02-28-2016
    Location
    australia
    MS-Off Ver
    2019
    Posts
    194

    Help on VBA to select all column dates into pivot fields

    Dear expertise

    I have vba code to create pivot from rawdata of DIS_Q1-Q4 into newsheet Amortization, i want make change on code to take dates from column I till end of column CRM Becoz the date range extend by month wise report. so starting date from column header I till CRM header.


    Please Login or Register  to view this content.
    let me know any tricks or possbile at Calcualte field options too

    Please find the attachment
    Attached Files Attached Files

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: Help on VBA to select all column dates into pivot fields

    Any of our VBA experts want to tackle this 1 please?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Contributor
    Join Date
    07-21-2011
    Location
    Bangalore,India
    MS-Off Ver
    Excel 2007,2010,2016
    Posts
    695

    Re: Help on VBA to select all column dates into pivot fields

    Any experts help on this?

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: Help on VBA to select all column dates into pivot fields

    I will push this again for you

  5. #5
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Help on VBA to select all column dates into pivot fields

    if im understanding what you are wanting....xlsum from first month until CRM
    then this code could work

    essentially loop every header from 9 until CRM adding datafield

    Please Login or Register  to view this content.
    Attached Files Attached Files
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  6. #6
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Help on VBA to select all column dates into pivot fields

    Where did you get this code from in the first place ??



  7. #7
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: Help on VBA to select all column dates into pivot fields

    Thanks for the assist, guys

  8. #8
    Forum Contributor
    Join Date
    02-28-2016
    Location
    australia
    MS-Off Ver
    2019
    Posts
    194

    Re: Help on VBA to select all column dates into pivot fields

    Thanks alot Experts Voluntarily who helped across my post

    which is driven me one more Last requirement!! I dont want add up all dates into datafield. I want add inputbox while run pivot intially it has to ask enter date from which entering date it has to take 10 dates towards right either it has less than 10 should not more than 10 but till end of CRM.

    if you help me out with this condition more grateful to you

    find the attachment
    Attached Files Attached Files
    Last edited by johnmacpro; 08-23-2016 at 03:17 AM. Reason: explain

  9. #9
    Forum Contributor
    Join Date
    02-28-2016
    Location
    australia
    MS-Off Ver
    2019
    Posts
    194

    Re: Help on VBA to select all column dates into pivot fields

    @snb
    Dear sir

    i found across google only and made changes according as per my requirement
    Last edited by johnmacpro; 08-23-2016 at 03:16 AM. Reason: explain

  10. #10
    Forum Contributor
    Join Date
    02-28-2016
    Location
    australia
    MS-Off Ver
    2019
    Posts
    194

    Re: Help on VBA to select all column dates into pivot fields

    Dear expert

    I have changed range of pivotfield date column from 16 to j and also changed "FT" but it doesnt works for me.

    Please Login or Register  to view this content.

  11. #11
    Forum Contributor
    Join Date
    02-28-2016
    Location
    australia
    MS-Off Ver
    2019
    Posts
    194

    Re: Help on VBA to select all column dates into pivot fields

    Dear expert

    I have changed range of pivotfield date column from 16 to j and also changed "FT" but it doesnt works for me.

    Please Login or Register  to view this content.
    please find the attachment some extent some of range of field in dates
    Attached Files Attached Files
    Last edited by johnmacpro; 08-24-2016 at 03:28 AM. Reason: explain

  12. #12
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Help on VBA to select all column dates into pivot fields

    Change counter equal 17 and then subsequently start loop on 17 instead of 16
    also change the colfield to extract the value in the same format as the header

    Please Login or Register  to view this content.

  13. #13
    Forum Contributor
    Join Date
    02-28-2016
    Location
    australia
    MS-Off Ver
    2019
    Posts
    194

    Re: Help on VBA to select all column dates into pivot fields

    Now i replace as j = ws1.Range("1:1").Find("ST").Column from is j = ws1.Range("1:1").Find("FT").Column its not take date into datafield

    as well one more requirement i want select Q1-13 only in report filter add this condition in code.

    Please Login or Register  to view this content.
    Last edited by johnmacpro; 08-26-2016 at 02:26 AM. Reason: addup

  14. #14
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Help on VBA to select all column dates into pivot fields

    you didnt update
    Please Login or Register  to view this content.
    this needs to be 17

  15. #15
    Forum Contributor
    Join Date
    02-28-2016
    Location
    australia
    MS-Off Ver
    2019
    Posts
    194

    Re: Help on VBA to select all column dates into pivot fields

    sir this one i want select Q1-13 only in report filter add this condition in code.

  16. #16
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Help on VBA to select all column dates into pivot fields

    you seem to sort of know how to amend code but it seems you have trouble with syntax

    here is some reading material for you

    http://www.thespreadsheetguru.com/bl...l-pivot-tables
    http://codevba.com/excel/PivotTable.htm
    http://www.databison.com/how-to-read...ble-using-vba/

  17. #17
    Forum Contributor
    Join Date
    02-28-2016
    Location
    australia
    MS-Off Ver
    2019
    Posts
    194

    Re: Help on VBA to select all column dates into pivot fields

    Thanks got it!! solved sir

+ 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. Select dynamic entries in pivot row fields
    By sahilkh18 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-08-2016, 06:56 PM
  2. Select Multiple Dates In Report Filter Pivot Table But Dates Are Not Static
    By biasedobserver in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-06-2014, 03:38 PM
  3. Compare 2 pivot fields and then de-select
    By thedon_1 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-17-2011, 06:57 AM
  4. vba - select pivot fields
    By abz in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-17-2010, 09:18 AM
  5. Differentiate between column fields and data fields in a pivot table
    By whiteheadw in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-12-2009, 01:59 PM
  6. Select / deselect pivot table fields with check box
    By fynn in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-26-2008, 08:12 AM
  7. use combo box to select pivot table page fields
    By penfold in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-04-2008, 09:55 AM

Tags for this Thread

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