Originally Posted by
alansidman
Rather than try to understand what you are trying to do with code that does not work for what you want, why not explain in simple English what you wish to happen. Read the yellow banner at the top of this page.
Hi Alan,
I want to make a button connected to a macro that updates a pivot table with today's (or yesterday's data)
see below code:
I need the "20211009" (YYYYMMDD) to change to today's date, (or yesterday's date) which I have coded in.
Aka (tomorrow) I will need the macro to run the following code on the 10th of Oct 2021.
"Str02" equals the above code, however it is a string and I need VBA to run this string as a piece of code, not as a string.
Bookmarks