+ Reply to Thread
Results 1 to 6 of 6

pi.Visible - Type Mismatch

  1. #1
    Forum Contributor
    Join Date
    05-13-2019
    Location
    Halifax, Canada
    MS-Off Ver
    2016
    Posts
    176

    pi.Visible - Type Mismatch

    Respected gurus, experts and MVPs,

    I have written the following code for the pivot table and it is generating pi.Visible - Type Mismatch error.

    Please Login or Register  to view this content.
    I had a similar error for the 2 other worksheets but after debugging for more than 5 hours, I could trace the lastrow mismatch error. The lastrow in the source worksheet for the Pivot Table was updated consisting of rows with irrelevant data inadvertently while debugging. When I noticed the range of data for Pivot Table and last row number different I deleted the irrelevant data, ran macro which updated the lastrow correctly and the filtered the date correctly.

    In the existing worksheet, the dates in the source worksheet are in date data type and the currep_date variable is set in date data type. I have been scratching my head for more than I did for before and researching articles in many websites to identify the error but I am still clueless.

    I appreciate for your time and sharing your valuable knowledge and request for any alternative solution to filter dates without changing the date datatype. I am attaching the worksheet and the picture file for your reference. When I changed the date to “General” NumberFormat it worked.

    Kind regards,
    Roshan Shakya
    Attached Images Attached Images
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    05-13-2019
    Location
    Halifax, Canada
    MS-Off Ver
    2016
    Posts
    176

    Re: pi.Visible - Type Mismatch

    Please consider this file. I use Excel 2010 version at work. The same file works on Excel 2016 without error.

    Thank you
    Roshan Shakya
    Attached Files Attached Files
    Last edited by Roshan.Shakya; 11-10-2019 at 06:20 AM.

  3. #3
    Forum Contributor
    Join Date
    05-13-2019
    Location
    Halifax, Canada
    MS-Off Ver
    2016
    Posts
    176

    Re: pi.Visible - Type Mismatch

    I guess, I found the solution.

    I checked my 3 sheets to compare why those 2 sheets had correct date filters and why this sheet did not.

    The answer was on DD-MM-YYYY format instead of any other formats. So I changed the dates by using TEXT(DATE,"DD-MM-YYYY") and ran the code; and it was perfect. It took me more than 10 hours searching for the solution and I found similar topic being mentioned in one of the posts in MrExcel (https://www.mrexcel.com/forum/excel-...se-errors.html).

    Thank you for reading.
    Roshan Shakya

  4. #4
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,474

    Re: pi.Visible - Type Mismatch

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however it has been brought to our attention that the same query has been posted on one or more other forums and you have not provided the required cross-post link(s) here.

    Please see Forum Rule #3 about cross-posting and adjust accordingly. Read this to understand why we (and other sites like us) consider this to be important.

  5. #5
    Forum Contributor
    Join Date
    05-13-2019
    Location
    Halifax, Canada
    MS-Off Ver
    2016
    Posts
    176

    Re: pi.Visible - Type Mismatch

    thank you davesexcel for enlightening this rule. I admit my mistake for not providing the links of my cross posts.

    please find below the crossposts as under:
    https://stackoverflow.com/questions/...-on-excel-2010
    https://www.mrexcel.com/forum/excel-...-mismatch.html

    I will abide by this rule now on.

  6. #6
    Forum Contributor
    Join Date
    05-13-2019
    Location
    Halifax, Canada
    MS-Off Ver
    2016
    Posts
    176

    Re: pi.Visible - Type Mismatch

    Dear all,

    I would like to put that my first choice to learn has always been the excelforum and I wanted to post this question in this forum but unfortunately my posts were denied by sucuri firewall. I could only find after some research today that symbols < > are not accepted in the posts. My title was "pi.Visible < Type Mismatch >" initially and this was accepted in stackoverflow forum. When I learnt this from post (https://www.excelforum.com/excel-new...ss-denied.html) then only I changed and posted in this forum.

    My intention is to learn from one of the best forums from many intelligent professionals. Whatever I learnt about VBA in the short span, I am extremely grateful to excelforum and the MVPs, forum experts, forum gurus, and forum moderators.

    If I have caused any harm or hurt somebody, please accept my apology.

    I would want to learn about this date behaviour (pi.Visible mismatch for dates) in Excel 2010 version and the alternative solutions in such cases.

    Kind Regards,
    Roshan Shakya

+ 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. Type mismatch
    By xtin0117 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-16-2015, 04:00 AM
  2. VBA type mismatch
    By dantray02 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-21-2014, 07:32 AM
  3. Run Type error 13 Type Mismatch
    By Affan Khan in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 11-13-2012, 12:58 PM
  4. [SOLVED] Run-type error 13 type mismatch
    By misop in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-05-2012, 04:08 AM
  5. [SOLVED] Type Mismatch: array or user defined type expected
    By ExcelMonkey in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-06-2006, 10:45 AM
  6. [SOLVED] Type mismatch using rnge as Range with Type 8 Input Box
    By STEVE BELL in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 12-03-2005, 01:10 AM
  7. [SOLVED] Help: Compile error: type mismatch: array or user defined type expected
    By lvcha.gouqizi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-31-2005, 05:05 PM

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