Some worksheets contain cells that have been left blank, e.g., in order to make the headings and subheadings easier to read. However, if for example you want to sort or filter the list or you want to use the table for analyses, you need to fill in the blanks. You could manually copy the value from the first filled cell above the blanks. An easier and faster way to do this is described on this site. The technique they describe requires the Go To function, which unfortunately is not available in Openoffice’s Calc. However, there is an alternative way (which works also in Excel).
- Select the cells in the column, including the column heading
- Choose menu Data | Filter | Auto filter
- Select -empty- from the auto filter drop down menu
- Note – you could obviously use the normal filter instead
- Type the reference to the cell above. For example, when the first empty cell is A3, fill in =A2
- Copy that cell and paste in the other empty cells
- Select ‘All’ from the auto filter drop down menu
Change the formulas to values:
- Select the entire column
- Choose Edit | Copy
- With the column still selected, choose Edit | Paste Special (Ctrl + Shift + v)
- De-select Formulas (and Formats if you want to retain the original formatting) and click OK (Note: Do this carefully if there are other cells in the range which contain formulas)
If you want to replace all blank cells by the same value you can use the Calc add-in ‘Special-Cells’, which you can download from OOoMacros. This add-in makes it very easy to, amongst others, select all blank cells in a column, row or table. Suppose for example that we want to fill in all blank cells with 999 ( I am assuming you have installed the SpecialCells add-in already).
- Select / highlight your row, column, or table of data containing the blank cells.
- Tools | Add-ons | Special Cells | Contents
- In the SpecialCells window select Blank Ranges and click OK
- Open the Find & Replace window (Edit | Find & Replace or Cntrl + F), leave the ‘Search for’ box blank, enter 999 in the ‘Replace with box’ and click the ‘Replace all’ button.