How To: Copy from a Grid to Excel
Whilst there is more than one way of copying from a Khaos Control grid to Excel, you may find this two-step process to be the most straightforward method:
- Exporting a grid to the clipboard
Note: this function is only available to Administrators and other users who have the 'Print/export grid' checkbox checkbox ticked in their "User Permissions" dialog. - Pasting the data into Excel
Exporting a grid to the clipboard
- Ensure the grid contains the data you wish to export.
- In the grid, green-select the cells you want to copy (e.g. by holding down the Ctrl key and left-clicking in the rows you want to select).
- Hint: You can use Ctrl+A to select the entire grid.
- Hint: You can use Ctrl+A to select the entire grid.
- Clicking on the small drop down arrow at the top left of the grid displays the Grid Menu.
- Choose
[ Send to Notepad ]
from the options to open the 'Export Columns' dialog box:- Note: this dialog shows the names of the columns from the current Grid which may not match those shown in this screenshot.
- Note: this dialog shows the names of the columns from the current Grid which may not match those shown in this screenshot.
- By default, all columns from the grid are included in the export.
To select a subset of these:- Pressing the "Exclude All" button turns off all columns, preventing them being exported (notice how the column names in the dialog box turn dark when they are excluded from the export).
- Pressing the "Include All" button turns on all columns, including them in the export.
- Clicking on the names of individuals columns toggles them between the excluded (darker coloured background) and included (lighter coloured background) state. The horizontal scroll bar that appears immediately below the column names allows the column names to be moved left and right.
- To set the output format, press the "Single Tabs" radio button.
- Press the "OK" button. This will:
- Write your selection to the default file (
C:\KeystoneSoftware\GridKC.txt
); and - Close the "Export Columns" dialog.
- Write your selection to the default file (
- The
GridKC.txt
file should then open automatically in Microsoft Notepad, with the data you have exported showing. Here is an example using data from our training system. Notice how the headings and columns do not always line up; this is because each column is separated from the next by a single tab character:
Note: If your computer has a program other than Microsoft Notepad associated with files having a ".txt" extension, you should seeGridKC.txt
open in that program instead. - To copy this data to the clipboard:
- Select the entire contents of the
GridKC.txt
file (e.g. Ctrl+A); and - Copy it to the clipboard (e.g. Ctrl+C).
- Select the entire contents of the
Pasting the data into Excel
- Startup Microsoft Excel.
- Open a new worksheet in Excel and make sure the current cell is A1 (top left hand corner of the worksheet).
- Paste the clipboard's contents into the worksheet (e.g. Ctrl+V).
- Carefully examine the data that has been pasted, looking for any data that should have leading zeroes (by default, Microsoft Excel uses the 'General' format for all columns in a new spreadsheet). Should any columns (e.g. Customer URN, Sales Order code) be missing its leading zeroes:
- Select the column.
- Set the affected column's format to be "text" (e.g. In Excel 2003, select 'cells' from the main window's 'Format' menu, click on 'text' and then press the "OK" button to close the dialog):
Note: Do not be tempted to shortcut this step by setting the entire spreadsheet to use text format, as currency values and other wholly numeric fields will not be stored correctly. - Put the cursor in cell A1 (top left hand corner of the worksheet).
- Paste the clipboard's contents into the worksheet (e.g. Ctrl+V), overwriting what you had previously pasted.
- Re-examine the data, repeating these steps as necessary until all columns containing data with leading zeroes have been formatted as text.
- Use Excel's "Replace All" command to delete the contents of any cells that contain '(empty)':
- Use Ctrl+H to display Excel's "Find and Replace" dialog;
- Enter '(empty)' into 'Find' and delete anything in 'Replace'; then
- Select 'Replace All':
- Save your new Excel worksheet.
- Close the window displaying the
KhaosKC.txt
file.