+ Reply to Thread
Results 1 to 4 of 4

VBA to set slicers to yesterdays date. What am I doing wrong?

  1. #1
    Registered User
    Join Date
    03-05-2011
    Location
    New York
    MS-Off Ver
    Excel 2016
    Posts
    84

    VBA to set slicers to yesterdays date. What am I doing wrong?

    im not very good with vba. I want to set the slicers on a separate workbook to yesterdays date. heres what i have so far. Getting an error on
    For Each si In sc.SlicerItems

    Please Login or Register  to view this content.

  2. #2
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: VBA to set slicers to yesterdays date. What am I doing wrong?

    Hi,

    What is the actual error message?
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  3. #3
    Registered User
    Join Date
    03-05-2011
    Location
    New York
    MS-Off Ver
    Excel 2016
    Posts
    84

    Re: VBA to set slicers to yesterdays date. What am I doing wrong?

    Quote Originally Posted by xlnitwit View Post
    Hi,

    What is the actual error message?
    Run-time error '1004':

    Application-defined or object-defined error

  4. #4
    Registered User
    Join Date
    03-05-2011
    Location
    New York
    MS-Off Ver
    Excel 2016
    Posts
    84

    Re: VBA to set slicers to yesterdays date. What am I doing wrong?

    Quote Originally Posted by xlnitwit View Post
    Hi,

    What is the actual error message?
    Any ideas? I can get this code to work if the slicer is in the macro workbook using Thisworkbook.Sc etc..

    I know theres just some syntax error somewhere when i do it like this.

    Edit: Added this sheet that i got working but cant figure out why it doesnt when i call another sheet.
    Attached Files Attached Files
    Last edited by beaglesBuddy; 07-27-2017 at 11:27 AM. Reason: Adding working sheet

+ 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] Build if/then for yesterdays date
    By Scalpel4 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 09-12-2016, 02:41 PM
  2. [SOLVED] look to see if yesterdays date or todays date is in worksheet
    By JRJLHJ1823 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-21-2015, 10:15 PM
  3. [SOLVED] VBA to loop through and delete all date except Yesterdays date.
    By shiva_reshs in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-09-2014, 11:30 AM
  4. Yesterdays date file
    By excelcandy in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-22-2013, 03:42 AM
  5. [SOLVED] Function/formula to compare and insert todays date or yesterdays date
    By TC922 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-17-2013, 05:28 AM
  6. How can I get yesterdays date in a custom footer &[DATE]-1 does .
    By chuck in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 02-18-2005, 10:06 AM
  7. Help with saving a workbook as yesterdays date.
    By justchris in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-11-2005, 08:28 AM

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