PERFORM ACTION ON HITTING ENTER


B

BigT

Hi all. I have a spreadsheet with a database query, a pivot table
based on that query and a summary page summarizing that data. The
data is date driven. I'd like to automatically refresh the query and
pivot table when hitting "enter" after typing in a new date. anyway
to do this?
I'm 2003 right now and will be upgrading in a few months to 2010.
 
Ad

Advertisements

I

isabelle

hi,

don't forget to adapt the sheets name and range name


Private Sub Worksheet_Change(ByVal Target As Range)
Set isect = Application.Intersect(Target, Range("summary"))
If Not isect Is Nothing Then
Sheets("PT").PivotTables(1).PivotCache.Refresh
Sheets("QT").QueryTables(1).Refresh BackgroundQuery:=True
End If
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top