Solved

Macro using SendKeys

Posted on 2014-11-24
9
85 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
 

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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Highlighting cells in Excel 9 17
Help with Excel formula 6 38
Avoid Multiple Instances of Named Ranges in Excel 3 22
Excel 17 16
INDEX and MATCH can be used to great effect to replace HLOOKUP and VLOOKUP as it does not have the limitation of needing the data to be sorted so that the reference value is in the first column or row. It also has the ability to perform a bi-directi…
This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

863 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now