Free Microsoft Excel 2013 Quick Reference

refresh button ?

Ok the thing is ... Im getting data from a database and i want to make a refresh button on my excel sheet so that when i add more data or move data around i can click the refresh button and everything will become organized again. Any help or thoughts would be greatly appreciated.. Thanks in advance.

Post your answer or comment

comments powered by Disqus
I need help urgently....i'm on a deadline of COB today...if anyone could tell me how to link cells from one workbook to another and being able to update figures using the refresh (!) button???

Thanks So Much

Hi, does anyone know a way to create a non-macro refresh button on a page. I have a table (I think it's a pivot), that takes data from anther table, but you have to right-click it and press Refresh Data, but I want to make a button on the sheet to do that.


Can anyone help me with some code, so I can add a button that replicates the ! (Exclamation mark) functionality in a pivot table.

I have some users who cannot cope with the right click option. I could add the refresh button onto their toolbars, but our IT seem to delete our customised toolbars each week.


I've created a sourc e data worksheet, that kicks out to a pivot table in
same workbook. I want to add button to the sheet where the user would just
have to select it, to refresh data. Just trying to make it easy for those
that may not have their pivot table bar up, or forget to click in chart to
bring up refresh button.

Any ideas

If I want to add a refresh button to a worksheet to update a web data query how would I do this?

I have some thoughts about making a command,button or whatever that can ease my pricelist adjustment job.
I have a price list of about 1000 rows. At the end of each row I have a cell with the actual price for the actual periode. The thing is that I update some of these prices once or twice a month. But now i want to add a new column where I type in the new price as I get it. Then when I have all the prices I need I was thinking about using a command button that will insert the new prices, that I have typed in, into the cells for the old prices. Like an update/refresh button actually.
Is this in anyway possible? Do you excel pro's understand what I want to do?

All answers appreciated


Is it possible to add a page some form of Refresh button to a cell, so when
clicked all the formulas/filters on that page will refresh.
I’m sure I have seen a spreadsheet containing a Macro in the past which lets
you do this (maybe wrong)..

Thanks in advance…

Hi All,

I need a macro, where the user when opens the file the popup button should appear and ask for Refresh - ok or cancel. If cancel then it should not refresh and if they click refresh then it should RefreshAll.

Please help....



I am thinking about making a little tool that will allow you to run a sql query against a database via odbc, then save the query with the workbook, so when you reopen that workbook you can refresh with the latest data from the database with a click of a button.

On one hand :

I think this can already be done reasonably easily in Excel

On the other :

Many people have told me it would be really useful.

What do you think ?

Sam H

Can you anyone point me in the right direction? (I am not an expert btw!). I have an excel spreadsheet that extracts information from an SQL database. I want to create a button that can refresh the data on click (I don't want to use the standard one)

Any ideas?


Hi All,

I am the new comer in here .
I have a question about Command button in excel.
I want to create Refresh Button with command from developer. Can you help me with this ?

The refresh button is the same as refresh from pivot table function.

Thank You

I have a workbook with 7 sheets:
Result Page, DW-1, PROD-1, DW-2, PROD-2, IP-2, IP-1

The Results page from top down;
A1-4 contain Start Date, End Date, Year, and Month (this date information is used in the SQL queries to pull the correct data.)
To their right is a Recalc button linked to Macro1
Under that, starting in A7 are the summation fields
Under that, starting at A30 are PivotTables.

DW-1, PROD-1, DW-2, PROD-2, IP-2, IP-1 Sheets contain the Raw data retrieved from SQL queries.

The problem i am having is that my Macro1 is not refreshing the data and pivot tables in the correct order... and thus my results are not appearing correctly and i have to run the marco twice. I have noticed in some other posts that the code:
Has worked but in my instance they are returning and error:
Run-Time error '1004': Unable to get the PivotTables property of the Worksheet class

I have looked for this error online but have found nothing as far as a solution... does anyone have any suggestions, please?

Sub Macro1()
' Macro1 Macro
    Response = Application.InputBox("Please enter in the Start Date as: MM/DD/YYYY", "Start Date",
Range("A1").Value, 50, 150, "", , 1)
    If Response <> False Then
       ActiveSheet.Range("A1").Value = Response
        MsgBox ("Exiting Input! No Calculation will take place")
        Exit Sub
    End If
    Response = Application.InputBox("Please enter in the End Date as: MM/DD/YYYY", "End Date",
Range("A2").Value, 50, 150, "", , 1)
    If Response <> False Then
       ActiveSheet.Range("A2").Value = Response
        MsgBox ("Exiting Input! No Calculation will take place")
        Exit Sub
    End If
    Worksheets("Result Page").Select
'    ActiveSheet.PivotTables("PivotTable-AUTF-Written").RefreshTable
'    ActiveSheet.PivotTables("PivotTable-HOMF-Written").RefreshTable
    Debug.Print "Macro1 ended"

End Sub


Lucky for me, I have been tasked with 'fixing' a button within a rather large and complex spreadsheet. The button merely refreshes a macro, which pulls data from a specific column in a separate worksheet - I'll call this Column A. The refresh works fine as long as a cell in Column A is selected when I click the button. However, if a cell outside of Column A is selected, and I try to refresh, I receive a VBA run-time error 1004 with the narrative 'Application-defined or object-defined error' (which I presume is indicating a cell within Column A needs to be selected) with the options to End or Debug. As a lot of people use this workbook, keeping a cell in Column A permenantly selected proves a little tricky.

My question is: can I alter the existing macro/create a new macro so that it doesn't matter whether a cell in Column A is selected?

All suggestions welcome.

Hey there,

I have an excel 2007 worksheet working as a database.

The formulas don't change their result immediatly after you change a cell that the formula depends on, until you press the "Save" button from excel.

I'd like to know how to make excel formulas update or refresh immeadiatly,
without having to create a macro,..

if not I'd like know to code a macro for me to add a button floating on my sheet to refresh or save my entire worksheet.

Thanks in advance


I have a workbook that pulls daily data into seperate sheets for each day i.e 1st = sheet 1 and so on for the entire month.
Each sheet has the relevent date the query looks at for the information to be populated with a refresh button next to it, each day I refresh the previous days relevent sheet. Is there a way to write code so that it would refresh the correct sheet each morning at a specific time say 08:00 am automatically on opening the workbook ?


I am trying to fill a Listbox dynamically. I have a range labeled 'Dates'. This range is created dynamically when i click a refresh button. New dates are grabbed from a database, then inserted into a worksheet, then the range 'Dates' is created to define the list of dates from the database. Also, I have a Clear Button. This button deletes all the dates in the worksheet, which I would want to clear all of the selections in the Listbox.

My Questions are:

1) How do i dynamically update a listbox with a Dynamic Named Range? I currently have vba to assign the ListFillBox property with the range name. However, when i click refresh to grab a new list of dates, the ListBox object freezes and/or does not refresh with the new dates.

2) How do i clear the listbox. Currently, I have vba to assign ListFillBox = "", however this will freeze the listbox and/or not clear its content.

I am using a multiselect listbox object.

Please feel free to include any other vba (whether its related to this problem or not) regarding ListBox objects, as I am rather novice on manipulating this type of component in excel vba.

Many Thanks,


Is it possible to put the standard Excel buttons (as in the ribbon in 2007 or the toolbars in 2003) actually on the spreadsheet. I would like, for example, to put the "pivot table refresh button" on my spreadsheet somewhere in the middle, separate from the program. Can I extract or import these Excel program's buttons somehow to insert elsewhere?


OK - let me apologise if I have put this in the wrong place or if it has been answered via another thread - I did try to find it - but could not.

I am very new to VBA - so forgive me for asking an obvious question. (if it is)

I have spreadsheet with some very basic formulas that work out sale prices based on people entering buy prices. (It works out the % margin).

There are certain areas where the user enters the data - and does not touch any other part of the sheet.

What I am trying to do is add a button which will remove the data from these cells. Almost - a start again button or refresh button. This way it will remove previously entered data - without removing formulas from the cells where the calculation happens. I think that is clear

So basically there are cells that a user will enter data - and it is these cells I would like to be able to clear with a button or similar without affecting other cells.

i have an excel spreadsheet with 27 or so workeets.
it contains sales figures in it.

I want to be able to link mutiple cells of this workbook to another workbook so that it retreives that data, So that when I hit the refresh (!) button it will automatically put the data in.

I will recieve new sales figures (new files) on a monthly basis so i want it to be able to update the figures to the new figures.

hope this makes sense- hope you can help me.............

Appreciate It!!!!


Is there any way to control the way the sql.request refresh occurs in Excel?

I'd like to use it on a larger spreadsheet, but when it updates so frequently, it slows everything down too much. I would prefer to set it to update when I hit a "refresh" button (or something to that effect).

I can handle the slow refresh, but I only want to run it when I decide to - not with any little change to any unrelated cell.

Any advice would be greatly appreciated.


Jason Schellenberg


I used the following code in Excel 2003 to update some sql queries, then the pivot tables that run from them.
The probelm i am having is that we have switched to Excel 2007 and now the Queries do not automatically refresh using this code.
What changes do i need to make for this to work in 2007?

     '******  procedure to refresh all Query Tables then all Pivot Tables on a spreadsheet **********
     'to be used via a refresh button
    Dim sh As Worksheet 
    Dim qt As QueryTable 
    Dim pt As PivotTable 
     'update QueryTables
    For Each sh In ActiveWorkbook.Sheets 
        For Each qt In sh.QueryTables 
            qt.EnableRefresh = True 
            qt.BackgroundQuery = False 
            qt.Refresh False 
            Application.StatusBar = False 
     'update PivotTables
    For Each sh In ActiveWorkbook.Sheets 
        For Each pt In sh.PivotTables 
            Application.StatusBar = False 
     'Update time last refreshed message and then save
    Dim lastrefresh As String 
    lastrefresh = Now() 
    ActiveCell.Value = lastrefresh 
End Sub 

If you like these VB formatting tags please consider sponsoring the author in support of injured Royal Marines


this is my first visit

i have a file with sales figures in it.

i want to be able to link cells from another workbook to my existing workbook by using a formula or another way.

I would like the info to be pasted into my original wrkbook after i click on the refresh (!) button

Thanks for your help in advance!


Every time I start my excel with the externa data queries in it it stops and waits until I push the stupid "Enable automatidc refresh" button before it lets me in.

I have tried "Refresh on Startup" in the query properties; I have tried lowering the macro security setting . . nothing seems to get this lame dialog box to leave me alone! I do not want it to show up when I open my file.

Anyone know how to turn it off?

tanks loads!

I am creating a worksheet that has an XML map to external data on a local server. The sheet will be shared on the network and have multiple users. I need to be able to have the user periodically refresh the XML data but when I protect the sheet, the refresh button is greyed out. Any way around this? Using Excel 2003. Thanks!

No luck finding an answer? You could always try Google.