Results 1 to 2 of 2

Thread: [VBA] Pivot Table make column headers show Day 12 instead of xx/xx/xxxx
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    New Member
    Join Date
    Oct 2019
    Posts
    4
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default [VBA] Pivot Table make column headers show Day 12 instead of xx/xx/xxxx

    I wasn't exactly sure how to word the title outside of providing the actual problem itself.

    I have a pivot table that has a dynamic amount of informaiton. My current pivot table has 27 unique dates, the next one I run could have 30 or even < 20.

    The column header we use is the Received Date and it is in the format of xx/xx/xxxx but I want it to produce an actual Day 1 if it was today, Day 2 if it was 1 days ago etc.

    I currently use a formula within the macro that uses a nested IF statement to do
    Code:
    =IF(RC[-1]=TODAY()-13, ""Day 13"", IF(RC[-1]=TODAY()-14, ""Day 14"", RC[-1]))
    However I am not sure if it is best practice to just continue the nested statement or is that my best bet?

  2. #2
    Board Regular jmacleary's Avatar
    Join Date
    Oct 2015
    Location
    at a desk in the UK
    Posts
    672
    Post Thanks / Like
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)

    Default Re: [VBA] Pivot Table make column headers show Day 12 instead of xx/xx/xxxx

    Hi there. This will produce the result you want i think:

    Code:
    =""Day ""&(TODAY()-RC[-1]+1)
    Last edited by jmacleary; Oct 9th, 2019 at 10:45 AM.
    If my answer has helped, please vote using the Thanks or Like buttons on the left.
    John

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •