Hi,
am not able to use VBA to update the dashboard, can you have a look and explain what's wrong please. I have followed the video tutorials religiously and all has been okay until now.
Thanks
Hi Fred,
Welcome to the forum! It's great to see you're working through the course.
The module name is missing from the Data sheet code in the sample file. In the video it shows this:
Private Sub Worksheet_Deactivate()
ThisWorkbook.RefreshPT
End Sub
That should fix it. I'll update the sample Excel file in the downloads. Sorry for the hassle.
Mynda
Thanks
Hello Mynda
I also had an error in the code.
I ran ThisWorkbook.RefreshPT but that still gave me an error, so I ran ThisWorkbook.RefreshAll and it works.
I know this isn't very efficient as it will slow the refresh down considerably if I have a lot of data, but not sure what else to do.
Any suggestions?
Thanks in advance.
Adam
Hi Adam,
The only reason I can think that you would have this problem if you are calling ThisWorkbook.RefreshPT is if the code in the Worksheet_Deactivate() event can't see the RefreshPT sub.
In the ThisWorkbook module you should have a sub called RefreshPT ? It should be declared like this:
Sub RefreshPT()
It shouldn't be preceded by the word Private.
If you can't get that to work please attach your workbook.
Regards
Phil
Ah Haaa, your a genius Phil, thank you.
I had this - Private Sub RefreshPT()
and removed the word 'Private' as you said, changed it to this - Sub RefreshPT()
and it works fine, thanks Phil, all good.
Cheers
Adam
No worries 🙂