Computer literacy, assistance and repair

How to run Microsoft Excel. How to run a macro in Excel in different ways

This is short step by step guide is intended for beginners and teaches you how to insert VBA (Visual Basic for Applications) code into an Excel workbook, and how to run the inserted macro to perform various tasks on that worksheet.

Most users are not gurus Microsoft Office. They may not know all the intricacies of how a particular function works, and will not be able to answer the question of how the speed of execution of a VBA macro differs in Excel 2010 and 2013. Many simply use Excel as a tool for data processing.

Let's say you need to change data in an Excel sheet in a certain way. We did a lot of googling and found a VBA macro that solves this problem. However, our knowledge of VBA leaves much to be desired. This is where it comes to the rescue step-by-step instruction, with which we can use the found code.

Inserting VBA code into an Excel workbook

In this example, we will use a VBA macro that removes line breaks from cells in the current Excel worksheet.

  1. Click Alt+Q to close the VBA editor window and return to the Excel workbook.

Running a VBA macro in Excel

To run the macro you just added, click Alt+F8. A dialog box will open Macro(Macro). On the list Macro name(Macro name) select the desired macro and click the button Execute(Run).

When working in Microsoft Excel, you may need to open several documents or the same file in several windows. In older versions and in versions starting with Excel 2013, this is not a particular problem. Just open the files in the standard way, and each of them will open in a new window. But in versions of the application 2007 - 2010, a new document opens by default in the parent window. This approach saves computer system resources, but at the same time creates a number of inconveniences. For example, if a user wants to compare two documents by placing windows side by side on the screen, then with the standard settings he will not be able to do this. Let's look at how this can be done in all available ways.

If in versions of Excel 2007 - 2010 you already have a document open, but you try to run another file, it will open in the same parent window, simply replacing the contents of the original document with the data from the new one. There will always be an option to switch to the first launched file. To do this, hover your cursor over the Excel icon on the taskbar. Small windows will appear to preview all running files. You can go to a specific document by simply clicking on this window. But this will be just switching, and not a full-fledged opening of several windows, since the user will not be able to simultaneously display them on the screen in this way.

But there are several tricks with which you can display multiple documents in Excel 2007 - 2010 on the screen at the same time.

One of the fastest options to solve the problem of opening multiple windows in Excel once and for all is to install the MicrosoftEasyFix50801.msi patch. But, unfortunately, Microsoft has stopped supporting all Easy Fix solutions, including the above product. Therefore, it is currently impossible to download it from the official website. If you wish, you can download and install the patch from other web resources at your own risk, but you should remember that by doing these actions you can expose your system to danger.

Method 1: Taskbar

One of the most simple options opening multiple windows is to perform this operation through the context menu of the icon on the taskbar.

  1. After one Excel document has already been launched, move the cursor over the program icon located on the Taskbar. Click on it with the right mouse button. The context menu launches. In it, depending on the version of the program, select the item "Microsoft Excel 2007" or "Microsoft Excel 2010".

    You can instead click on the Excel icon on the taskbar with the left mouse button while holding down the key Shift. Another option is to simply hover the cursor over the icon and then click the mouse wheel. In all cases, the effect will be the same, but you will not need to activate the context menu.

  2. A blank Excel sheet opens in a separate window. In order to open a specific document, go to the tab "File" new window and click on the item "Open".
  3. In the file opening window that opens, go to the directory where the required document, select it and click on the button "Open".
  4. After this, you will be able to work with documents in two windows at once. In the same way, if necessary, you can launch a larger number.

    Method 2: Run window

    The second method involves operating through a window "Run".

    1. Type a key combination on the keyboard Win+R.
    2. The window is activated "Run". We type the command in its field "excel".

    After this, a new window will open, and in order to open the desired file in it, we perform the same steps as in the previous method.

    Method 3: Start Menu

    The following method is only suitable for users of Windows 7 or earlier versions of the operating system.

    After these steps, a new program window will open, in which you can open the file in the standard way.

    Method 4: Shortcut on the Desktop

    To launch Excel in a new window, you need to double-click on the application shortcut on your desktop. If it does not exist, then a shortcut must be created.


    Now you can launch new windows through the application shortcut on the Desktop.

    Method 5: Open via context menu

    All the methods that were described above involve first launching a new Excel window, and only then through the tab "File" opening a new document, which is a rather inconvenient procedure. But it is possible to make opening documents much easier by using the context menu.

    The document will open in a new window.

    Having performed the operation once with adding a shortcut to the folder "SendTo", we now have the ability to permanently open Excel files in a new window via the context menu.

    Method 6: Changes in the system registry

    But you can make opening Excel files in multiple windows even easier. After the procedure that will be described below, all documents opened in the usual way, that is, by double-clicking the mouse, will be launched in a similar way. True, this procedure involves manipulation of the system registry. This means that you need to be confident in yourself before taking it up, since any wrong step can fatally harm the system as a whole. In order to be able to correct the situation in case of problems, before starting manipulations, make a system restore point.


    After completing this procedure, xlsx files will also open in a new window.

    Method 7: Excel Options

    Opening multiple files in new windows can also be configured through Excel options.


    After this, new running files will open in separate windows. At the same time, before finishing work in Excel, it is recommended to uncheck the "Ignore DDE requests from other applications", since otherwise, the next time you start the program, problems may arise with opening files.

    Therefore, in a way, this method less convenient than the previous one.

    Method 8: Open the same file multiple times

    As you know, Excel usually does not allow you to open the same file in two windows. However, this can also be done.


    As you can see, although by default Excel 2007 and 2010 will open multiple files in the same mother window when launched, there are many ways to launch them in different windows. The user can choose a more convenient option that suits his needs.

By pressing a button Start activate the main menu, place the mouse pointer on the item Programs, in the menu that appears, place the mouse pointer on the item Microsoft Excel and click on it.

Microsoft Excel program window. When you hover your mouse over some areas of the window (total 17 fragments highlighted ), the pointer will turn into a palm and a tooltip will appear with the name of the specified window area.

The Excel document is called Workbook, the book is a collection Worksheets, each sheet has a tabular structure and can contain one or more tables. The Excel document is saved as a file with the extension *.xls. The document window only displays current worksheet, it's called active. Each worksheet has Name, which is displayed on sheet label. Using shortcuts, you can switch to other worksheets in this book. Each sheet has horizontal and vertical scroll bars. The work window contains a standard title bar, toolbars, and a line containing the name field and formula bar. At the bottom of the window there is a status bar. At the right end of the status bar is the inscription NUM if the Num Lock mode (small numeric keypad) is enabled on the keyboard.

Task 1.1: Start the program.

1. Method 1. Click the button Start taskbar, in Main menu select item Programs, in the submenu that appears, place the mouse pointer on the item Microsoft Excel and click on it.

2. Close the program window with the command File/Output.

3. Method 2. Find the Microsoft Excel shortcut on your desktop and double-click it to activate it.

4. Close the program window by pressing Alt+F4.

Cell addressing

The worksheet consists of lines And columns. The columns are headed in capital Latin letters (A, B,... AA,..., IV), the maximum number of columns is 256. The lines are headed with numbers, the maximum number of lines is 65536. At the intersection of rows and columns there are cells tables. Designation ( address, link) cells is made up of column and row numbers. One of the cells is always active and stands out framed. The frame of the active cell acts as a cursor. The active cell headings are bold and raised in bold relief.

Example. In the figure, the address of the active cell is A5.

The frame can be moved using the mouse or cursor keys. To select a cell, just click on it with the left mouse button, and it becomes active. Scroll bars and the Home, Ctrl+Home, Page Up, Page Down keys are also used to move around the sheet. The Name field displays the address of the active cell.

Example. F4, E8, A1.

There is another way to address a cell. Columns are specified by numbers, the row number is preceded by the letter R, and the column number is preceded by the letter C.

Example. Cell addresses from the previous example, specified in a different way: R4C6, R8C5, R1C1.

When cells are selected, the mouse pointer appears as a white cross.

Task 1.2: Addressing and allocation of cells.

1. Select cells with addresses A5, B1, F40 in turn using the mouse or cursor keys and scroll bar.

2. Check the actions of the Home keys (to column A of the current row), Ctrl+Home (to cell A1), Page Up (one screen up), Page Down (one screen down), when moving through table cells.

3. Set the cell name style R1C1 using the menu command Service/Options/tab_ Are common/Set_checkbox_ Link_style _ R1C1.

4. Determine the addresses of cells A5, B1, F40 in the current style (R5С1, R1C2, R40C6).

5. Return to the previous addressing of cells using the menu command Service/Options/ Tab_ Are common/Uncheck_checkbox Link_style_R1C1.

From the Start menu, select All Programs, and then Microsoft Office Microsoft Office Excel 2003 (Fig. 11.2);

Double-click with the left mouse button on any Excel workbook in the Open Office Document dialog box.

If you have already launched Microsoft Excel and then switched to working with other programs, left-click on the minimized Excel window in the taskbar to open it.

Excel main window

In Fig. Figure 11.3 shows the main window of the Microsoft Excel spreadsheet editor. It depicts the following elements:

1. The cursor is a rectangle with a thick border surrounding the active cell along the perimeter. To select another cell, left-click inside it. Alternatively, use the arrow keys, Tab or Enter, or use the keyboard shortcut Shift+Tab or Shift+Enter.

2. Menu bar. Click on any item to open the corresponding menu.

3. The formula bar displays the contents of the active cell. You can enter and change data right here or in the cell itself.

4. The Standard toolbar contains buttons that, when pressed, execute standard commands that allow you to work with files, edit text, etc.

5. The buttons on the Formatting toolbar are designed to format cells and their contents.

6. Clicking on a column header allows you to select the entire column. Drag across multiple headers while holding down the left mouse button if you want to select multiple columns.

7. Using the scroll buttons, you can view the entire sheet of the Excel workbook on the screen, as well as move to the next, previous, first or last sheet of the workbook.

8. Click on the row header to select the entire row. Drag your mouse across multiple headings to highlight a number of rows.

9. Sheet labels. By clicking on the tabs, you will alternately display different sheets on the screen. If you need to rename a sheet, double-click on its tab and enter a new name.

10. And the status bar displays information about the current sheet or operation in progress.

11. Mode indicators register the activation of special modes, for example, the mode for changing the case of letters (while the Caps Lock key is pressed).

12. The task area provides quick access to Excel documents, the clipboard, search options for files and Clipart objects.

13. Office Assistant - a program that displays information from sections of the help system of the Microsoft Excel package.

Before you start working with Microsoft Office Excel, you can have Excel automatically open a specific workbook, either a workbook template or a worksheet template with custom settings, when you start Excel. If you no longer want to open a specific workbook, you can stop opening it when you start Excel.

If the workbook that is open when you start Excel contains automatic macros, such as Auto_open, those macros will run when you open the workbook. If necessary, you can prevent them from starting automatically when you start Excel.

Adviсe:

    You can also customize the way Excel starts by adding options to the startup command command line and parameters.

    For more information, see Command Line Options for Microsoft Office Products.

Start Excel automatically using a blank workbook

In Excel 2013 and later versions, Excel, by default, displays a Start screen with the latest workbooks, locations, and templates when launched. You can change this setting to bypass this screen and create a blank workbook. Here's how to do it.

    Click Options _gt_ file.

    In chapter Are common and then in the section Launch parameters check checkbox show the start screen when you launch this application.

    Click the button OK.

Finding the XLStart folder

Any workbook, template, or workspace file you place in the XLStart folder automatically opens when Excel starts. To find the path to the XLStart folder, check your Trust Center settings. Here's how to do it.

    Select File > Options.

    Click security control center and then in the section Microsoft Office Excel Trust Center select item Trust Center Settings.

    Select an item Trusted Locations and check the path to the XLStart folder in the list of trusted locations.

    Select File > Options > Additionally.

    In chapter Are common in field at startup select Open all files in Enter the full path to the folder you want to use as an alternative startup folder.

    Because Excel will try to open every file in the alternate Startup folder, make sure you specify a folder that contains only files that Excel can open.

Note:

    Perform one of the following actions.

    • To use a workbook template, create a workbook that contains sheets, default text (such as page headings, column and row names), formulas, macros, styles, and other formatting options that will be used in new workbooks based on the workbook template.

      To use a worksheet template, create a workbook that contains one worksheet. On a sheet Add the formatting, styles, text, and other information that you want to appear on all new sheets that will be based on the sheet template.

      • Cell and sheet formats.

        Page formats and print area settings for each sheet.

        Cell styles.

        Number and type of sheets in the book.

        Protected and hidden areas of the book. You can hide sheets, rows, and columns and prevent sheet cells from being modified.

        Text that you want to repeat, such as page titles, row titles, and column titles.

        Data, pictures, formulas, charts and other data.

        Data verification options.

        Calculation options in the workbook and window presentation options.

    On the tab File select team Save as.

    In field File type select item sample.

  1. In field file name Do one of the following:

    • To create a default book template, enter Book.

      To create a default sheet template, enter sheet.

      To create a custom workbook or worksheet template, enter the name you want to use.

  2. Click the button file _gt_ Close.

Automatically open a specific workbook when you start Excel

To automatically open a specific workbook when Excel starts, you can place it in the XLStart folder or use an alternative Startup folder in addition to the XLStart folder.

Placing a book in the XLStart folder

Any workbook, template, or workspace file you place in the XLStart folder automatically opens when Excel starts. This XLStart folder was created when Excel was installed and is typically located in one of the following locations.

Using an alternative startup folder

Note: If a workbook with the same name is in the XLStart folder and in the additional startup folder, the file in the XLStart folder will open.

Stop a specific workbook from opening when Excel starts

Depending on the location of the workbook that automatically opens when Excel starts, do any of the following to ensure that the workbook no longer opens when you start.

Automatically open a workbook or worksheet template when you start Excel

You can save frequently used workbook settings in a workbook template, and then automatically open that workbook template every time you start Excel.

Disable macros from running automatically when Excel starts

Automatic macros (for example, Auto_open) that were written to a workbook that opens when Excel starts will automatically run immediately after the workbook is opened.

    To prevent macros from running automatically, hold down the SHIFT key when you start Excel.

Related publications