Outils pour utilisateurs

Outils du site


issue53:tutolibre

Ceci est une ancienne révision du document !


Calc is the spreadsheet module of LibreOffice, which is compatible with Microsoft's Excel. We already saw one use for Calc when we created our poor man's database in my last article, but Calc is capable of more than just data collection. As the name implies, Calc can do calculations using a rich number of functions built into the program. This means we don't have to manually calculate the total of some column; we can insert a formula to add it up for us. Calc also allows you to do a “what if..” scenario to play with the numbers in your spreadsheet. Before we get into building our budget spreadsheet, you need to know a few things about how a file, sometimes referred to as a workbook in Calc, works. Each file can contain several different spreadsheets. In a new workbook, you get three spreadsheets by default named sheet1, sheet2, and sheet3. They are listed on tabs at the bottom of the window. Each spreadsheet consists of individual cells. You identify the cells by their column letter and row number. For example, the first cell in the upper left hand corner is A1, the first column, first row. Each spreadsheet is capable of having 1,024 columns and 1,048,576 rows.

Calc est le module tableur ou feuille de calcul de LibreOffice ; il est compatible avec Excel de Microsoft. Nous avons déjà vu une façon d'utiliser Calc quand, dans mon dernier article, nous avons créé notre base de données primitive, mais Calc peut faire beaucoup plus que la collecte de données. Comme son nom l'indique, Calc peut faire des calculs avec de très nombreuses fonctions intégrées au programme. Cela veut dire que nous ne sommes pas obligés de calculer la somme des entrées dans une colonne à la main ; nous pouvons insérer une formule qui fera l'addition à notre place. Calc vous permet de créer un scénario « Et si… » et jouer avec les chiffres dans votre classeur.

Avant de commencer la construction de notre classeur budget, vous avez besoin de connaître certaines choses sur comment un fichier, parfois appelé un classeur dans Calc, fonctionne. Chaque fichier peut contenir plusieurs feuilles de calcul différents. Dans un nouveau classeur, vous avez par défaut trois feuilles de calcul, appelées Feuille1, Feuille2 et Feuille3. Leur nom figure sur des onglets en bas de la fenêtre. Chaque feuille est composée de cellules individuelles, identifiées par la lettre de leur colonne et le numéro de leur ligne. Par exemple, la première cellule en haut et à gauche est A1, la première colonne, la première ligne. Chaque feuille peut avoir jusqu'à 1.024 colonnes et 1.048.576 lignes.

[LibreOffice_Calc_Screen.png]

The layout of the Calc window is a little different than the Writer window. You still have a menu bar and formatting bar, but below the formatting bar, you have the formula bar. The formula bar is your friend when you work in Calc. The leftmost box is the current cell name box. It tells you the currently selected cell or range of cells. The three buttons are the function wizard, the sum button, and function button. The text box is the input line. Use it to edit the contents of a cell. At the top of your spreadsheet, you have the column headers (A, B, C…), and along the left hand side, you have the row headers (1, 2, 3…). The columns and rows are marked on the sheet by light gray lines. You will find this grid handy when you are laying out your spreadsheet.

La disponsition d'une fenêtre Calc est quelque peu différente de celle d'une fenêtre Writer. Il y a toujours une barre standard et une barre de formatage, mais en dessous de celle-ci, vous verrez la barre de formule. Cette barre est votre amie quand vous travaillez dans Calc. La case tout à fait à gauche indique le nom de la cellule actuelle. Il vous dit quelle cellule, ou groupe de cellules, est sélectionné à un moment donné. Les trois icônes immédiatement à droite de cette case sont l'assistant fonctions, le bouton somme et le bouton fonction. Encore à droite, vous verrez la ligne de saisie que vous devez utiliser pour modifier le contenu d'une cellule.

En haut de la feuille, vous avez les en-têtes de colonne (A, B, C…) et, le long du côté gauche, les en-têtes de ligne (1, 2, 3…). Les colonnes et les lignes sont matérialisées sur la feuille par des lignes gris clair. Cette grille sera utile lors de la conception de votre feuille de calcul.

You have several choices in the way you enter data into the cells. You can click on the cell and just start typing. When you have finished, press enter and you will move to the cell below. You can also click on a cell and enter your data in the input line of the formula bar. This method has a drawback, which I will explain in a minute, but sometimes, it is the best method for editing the content of a cell. You can edit directly in the cell by double-clicking the cell. This puts you in cell edit mode. This mode is similar to editing in the formula bar. To navigate within your spreadsheet, you can always grab the mouse and click on the cell you want. However, since often your hands are already at the keyboard, keyboard shortcuts work better. Tab moves you one cell to the right. Shift-Tab moves you one cell to the left. Enter moves you one cell down, and Shift-Enter moves you one cell up. While not in edit mode or not using the input line, the arrow keys move you in the direction of the arrow. The arrow keys are disabled for navigation while in the input line and in edit mode to allow you to move within your content.

Il y a plusieurs façons de saisir des données dans une cellule. Vous pouvez cliquer dessus et commencer à taper. Quand vous avez terminé, appuyez sur Entrée et vous vous retrouverez dans la cellule en dessous. Vous pouvez aussi cliquer sur une cellule et entrer les données dans la ligne de saisie de la barre de formule. Cette méthode a un inconvénient que j'expliquerai dans une minute, mais, parfois, c'est la meilleure façon de modifier le contenu d'une cellule. Vous pouvez aussi l'éditer dans la cellule, en double-cliquant dessus, ce qui vous met en mode édition. Modifier une cellule dans ce mode est similaire à son édition dans la barre de formule.

La navigation à l'intérieur de votre feuille peut se faire à la souris : il suffit de cliquer sur la cellule que vous souhaitez. Cependant, puisque vos doigts sont souvent déjà sur le clavier, les raccourcis clavier fonctionnent mieux. La touche de tabulation (Tab) vous met dans la cellule immédiatement à droite de celle où vous vous trouviez. Maj+Tab vous met dans la cellule immédiatement à gauche. Appuyez sur Entrée et vous serez dans la cellule en dessous de celle ou vous étiez et, avec Maj+Entrée, vous serez au-dessus. Si vous n'êtes pas en mode édition, ni en train d'utiliser la ligne de saisie, les touches fléchées vous déplacerez dans la direction de la flèche. Les touches fléchées sont désactivées pour la navigation si vous êtes dans la ligne de saisie ou en mode édition pour vous permettre de bouger à l'intérieur du contenu.

Now, with these tools on your belt, let's build the first section of our budget spreadsheet. Open a new Calc file. Click on the blank gray spot to the left of the column header and above the first row header. This will select the entire sheet. In the formatting bar, set the font to a nice sans-serif font like Arial, and set the font size to 12pt. By doing this, we have set the default font and size for our entire sheet.

In cell A1, enter the text “Income for This Period,” and press Enter. For now, don't worry if the text overruns the cell. We will fix that in a minute. On the second row of column A, type in “Sources”. Down column A starting with row 3, type in the different types of income you have, e.g. Work, Freelancing, Bonus. I usually add a “Misc” for those things that don't fit into other categories, like winning the lottery and quiting your day job.

[adjust_column.png]

At this point, some of your income sources may overflow their cells. We can adjust the width of the column by clicking between the cell headers for A and B and dragging. We are still not concerned with the cell A1. At this point, A1's overflow is okay, just make sure all your income sources fit in the column.

[Format_Cells_Numbers.png]

Move to cell B2. Type in “Amount”. Press Enter. Down column B, enter an amount for each of the income sources. You will notice the default for numbers is just some unformatted numbers. Let's make them look like currency amounts. We will change them all at once. You can select all the numbered cells by click with the left mouse button and dragging until you have all the numbers highlighted. You can also click on the first cell, hold down the Shift ke,y and click on the last one. With the keyboard, use Shift in combination with the arrow keys. Format > Cells > Numbers. Select the Currency category. Above the format box, select the correct currency type for your country. Select a currency format from the format box. This is entirely up to you. Since you should never have a negative figure in your income cells, you don't need to worry too much about formats that deal with negative numbers.

Now, we will take care of A1 overflowing into B1. Since this text is a heading for the section, we want it to span across the width of the section. Cell Merge is the answer. Highlight cells A1 and B1, and Format > Merge Cells > Merge and Center Cells. We will use merge cells a lot, and it should become one of your favorite formatting features. Unfortunately, there is no keyboard shortcut. You can create one in Tools > Customize > Keyboard, but take care that you don't assign the keyboard shortcut to a common or predefined functionality.

Now, let's make it look like a header. Let's make the font bold, Format > Cells > Font tab. Select bold under Typeface. Let's put a border around it to make it stand out just a little more. Click on the Borders tab. Under Default, click the second box, Set All Four Borders. Leave the style at the default, but change the color to gray. Click OK.

[Format_Cells_Border.png]

With our Source and Amount headings, we want them to stand out as well, but they need to look a little different to distinguish them from the section header. Select the two cells with Source and Amount in them. Format > Cells > Font tab. Select bold again. Click on the Borders tab. This time we just want a border between the two cells. Click in the User-defined box between the two gray boxes with a white X in them. You will see a line between the two. Change the color to gray. On the Alignment tab, change the alignment for horizontal to center and vertical to middle. On the Background tab, select a light blue (Blue 8) for the background color. Click OK.

For our income items, we could put a border around them, but that can be hard to read sometimes. Instead, let's highlight the even numbered rows. Start with the second item, highlight both the name and its amount. Format > Cells > Background tab. Select a light gray for the background. I used Gray 10%. Click OK. Repeat for all the even rows.

It would be nice to have a divider between the name and the amount and a border around the whole list. Click on the first name, hold the Shift key, and click on the last amount. This should highlight all the items and their amounts. Format > Cells > Border tab. Under Default select the second box, Set Outer Border Only. You will notice the User-defined box is different this time. There are four gray boxes with white X's in them. Click between the top two boxes. This will give you a vertical line between the cells. If you click in the middle, it will create a vertical and horizontal line, which is not what we want. Change the color to gray and click OK.

[Income_Section.png]

This completes the Income section of our spreadsheet. In the next article, we will continue with our budget spreadsheet by adding the Assets section. And we will begin looking at making our spreadsheet do some math for us using the Sum function.

issue53/tutolibre.1318426838.txt.gz · Dernière modification : 2011/10/12 15:40 de auntiee