Link to home
Start Free TrialLog in
Avatar of Frank Freese
Frank FreeseFlag for United States of America

asked on

Macro using SendKeys

Folks,
I know of several ways to refresh data in a pivot table. The one I am interested in doing is a macro using SendKeys, "Alt + F5". Possible?
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

What happens if you record a macro while doing it manually, undoing the change and then running the macro?
Avatar of Frank Freese

ASKER

I tried that and nothing was recorded.
I'm "thinking" this will work?

Sub UpdatePivot()

SendKeys "%{F5}"

End sub
Sure but (and I don't know much about pivot tables) would you need to add code to select the table?
All the user has to do is click on the pivot table. I don't know how to select a pivot table vba, yet!?
I can select a pivot table using vba - but the pivot table name would have to remain static and I'm not sure how that's going to hold up?
ASKER CERTIFIED SOLUTION
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thanks Martin
Have a Happy Thanksgiving
thank you kindly sir