Solved

Macro using SendKeys

Posted on 2014-11-24
9
86 Views
Last Modified: 2014-11-24
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?
0
Comment
Question by:Frank Freese
  • 5
  • 4
9 Comments
 
LVL 46

Expert Comment

by:Martin Liss
ID: 40462846
What happens if you record a macro while doing it manually, undoing the change and then running the macro?
0
 

Author Comment

by:Frank Freese
ID: 40462860
I tried that and nothing was recorded.
I'm "thinking" this will work?

Sub UpdatePivot()

SendKeys "%{F5}"

End sub
0
 
LVL 46

Expert Comment

by:Martin Liss
ID: 40463004
Sure but (and I don't know much about pivot tables) would you need to add code to select the table?
0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 

Author Comment

by:Frank Freese
ID: 40463063
All the user has to do is click on the pivot table. I don't know how to select a pivot table vba, yet!?
0
 

Author Comment

by:Frank Freese
ID: 40463079
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?
0
 
LVL 46

Accepted Solution

by:
Martin Liss earned 500 total points
ID: 40463145
This refers to the 1st pivot table on the sheet.

ActiveSheet.PivotTables(1).Name
0
 

Author Comment

by:Frank Freese
ID: 40463233
thanks Martin
Have a Happy Thanksgiving
0
 

Author Closing Comment

by:Frank Freese
ID: 40463235
thank you kindly sir
0
 
LVL 46

Expert Comment

by:Martin Liss
ID: 40463248
YW U2
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http:/Q_27311462.html), I created an alternative function to the Excel Concatenate() function that you might find useful.  I tested several solutions and share the results in this article as well as t…
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question