Why separate worksheets when using excel?

Using macro, how do i refresh all worksheets in excel file?

  • I have an excel file which is linked to another excel file stored on the network. using macro, i need to update/refresh this file at set intervals as the data in the source file is updated frequently. I am a beginner at this so please help

  • Answer:

    First of all, you did not specify which version of MS-Excel you are using. So I will assume it to be 2003 or earlier. Here is the basic information to refresh imported data. Refreshing Data -------------------------- • Automatically refresh data when a workbook is opened. You can refresh an external data range automatically when you open the workbook, and optionally save the workbook without saving the external data, so that the workbook file size is reduced. 1. Click a cell in the external data range you want to refresh, and then click Data Range Properties on the External Data toolbar. 2. Select the Refresh data on file open check box. 3. If you want to save the workbook with the query definition but without the external data, select the Remove external data from worksheet before saving check box. • Refresh multiple external data ranges. 1. If your worksheet contains more than one external data range that you want to refresh, on the View menu, point to Toolbars, and click External Data. 2. On the External Data toolbar, click Refresh All to refresh all of the external data ranges in the workbook. If you have more than one workbook open, you must click Refresh All in each workbook to refresh external data. • Refresh data in an imported text file. 1. Select the worksheet with your imported text file. 2. Click Refresh Data on the External Data toolbar. 3. In the Import Text File dialog box, select your text file, and then click Import. Tip: If you want to import only part of the data in a text file as a refreshable data range, you can create a query to retrieve the data. For more information, see Microsoft Query Help. • Automatically refresh data at intervals. 1. Click a cell in the external data range, and then click Data Range Properties on the External Data toolbar. 2. Select the Refresh every box, and then enter the number of minutes between refreshes. • Control the order of refreshes. 1. Click a cell in the external data range you want to refresh first, and then click Refresh Data on the External Data toolbar. 2. Repeat for each external data range until they are all refreshed in the order you want. Setting Refresh Options ------------------------------------- • Require a password to refresh an external data range. If your data source requires a password to connect to it, you can require that the password is entered before the external data range can be refreshed. This procedure does not apply to data retrieved from a text file (*.txt) or a Web query (*.iqy). 1. Click a cell in the external data range, and then click Data Range Properties on the External Data toolbar. 2. Under Query definition, clear the Save password check box. Notes: - - - - • Stored passwords are not encrypted. - - - - • Microsoft Excel prompts for the password only the first time that the external data range is refreshed in each Excel session. The next time you start Excel, you will be prompted for the password again if you open the workbook that contains the query, and then click Refresh Data. • Preserve cell formatting when you refresh an external data range 1. Click a cell in the external data range, and then click Data Range Properties on the External Data toolbar. 2. Do one or both of the following: - - - - • If you want to preserve cell formatting that you apply, select the Preserve cell formatting check box under Data formatting and layout. - - - - • If you want to preserve column widths that you set, clear the Adjust column width check box under Data formatting and layout. 3. Click OK. 4. To refresh the external data range, click Refresh Data on the External Data toolbar. • Run a query in the background or while you wait. Running a query in the background allows you to use Microsoft Excel while the query runs. 1. Click a cell in the external data range, and then click Data Range Properties on the External Data toolbar. 2. Select the Enable background refresh check box to run the query in the background or clear it to run the query while you wait. Notes: - - - - • Stop a query. To stop a query from running when Enable background refresh is turned off, press ESC. - - - - • Stop a background refresh. To stop a query that is running in the background, double-click the Background Refresh icon on the status bar to display the External Data Refresh Status dialog box, and then click Stop Refresh. - - - - • Recording a macro. While you are recording a macro that includes a query, Excel will not run the query in the background. To change the recorded macro so that it runs in the background, edit the macro in the Visual Basic Editor and change the refresh method for the QueryTable object from "BackgroundQuery := False" to "BackgroundQuery := True". For information about editing macros, see Visual Basic Help. Note: You can check the status of a refr

Shardul P at Yahoo! Answers Visit the source

Was this solution helpful to you?

Other answers

A macro is a task or set of tasks used frequently. Using a macro to update a file is a fairly simple operation. Tools, Macro, Record new, Give the macro a name and assign a shortcut key. The box then minimises to just show the macro toolbar. The macro records the keys pressed, in the sequence they are pressed and includes any mouse clicks and where they are. A macro also requires physical input from you as the macro will not just run on its own. If the spreadsheet you are working on references the data in the other file, then when you open the spreadsheet, you should be asked whether you wish to update the info or not. If you want to update, then simply click yes (update). This won't require the use of a macro at all.

raceace48

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.