# Setting Up the Rows and Columns of the Register

Learn how to set up rows and columns for a checkbook register in this tutorial. Customize the control and sheet dimensions with code examples in C# and VB.

## Content

The Spread control on your form already has a sheet, ready for you to configure. In this step, you are going to set up the columns and cells in the sheet to resemble a checkbook register.

## Using Code

1. Double-click on the form in your project to open the code window.
2. In the Form Load event, type the following code:
    This code sets up the control to be 300 pixels high and 763 pixels wide, and the sheet to have 8 columns and 100 rows.
    **Example**

    ```csharp
    // Set up control and rows and columns in sheet.
    fpSpread1.Height = 330;
    fpSpread1.Width = 765;
    fpSpread1.Sheets[0].ColumnCount = 8;
    fpSpread1.Sheets[0].RowCount = 100;
    ```

    ```vbnet
    ' Set up control and rows and columns in sheet.
    fpSpread1.Height = 330
    fpSpread1.Width = 765
    fpSpread1.Sheets(0).ColumnCount = 8
    fpSpread1.Sheets(0).RowCount = 100
    ```
3. Next set up the columns to add custom headings. Add the following code below the code you added in Step 2:
    **Example**

    ```csharp
    // Add text to column heading.
    fpSpread1.Sheets[0].ColumnHeader.Cells[0, 0].Text = "Check #";
    fpSpread1.Sheets[0].ColumnHeader.Cells[0, 1].Text = "Date";
    fpSpread1.Sheets[0].ColumnHeader.Cells[0, 2].Text = "Description";
    fpSpread1.Sheets[0].ColumnHeader.Cells[0, 3].Text = "Tax?";
    fpSpread1.Sheets[0].ColumnHeader.Cells[0, 4].Text = "Cleared?";
    fpSpread1.Sheets[0].ColumnHeader.Cells[0, 5].Text = "Debit";
    fpSpread1.Sheets[0].ColumnHeader.Cells[0, 6].Text = "Credit";
    fpSpread1.Sheets[0].ColumnHeader.Cells[0, 7].Text = "Balance";
    ```

    ```vbnet
    ' Add text to column heading.
    fpSpread1.Sheets(0).ColumnHeader.Cells(0, 0).Text = "Check #"
    fpSpread1.Sheets(0).ColumnHeader.Cells(0, 1).Text = "Date"
    fpSpread1.Sheets(0).ColumnHeader.Cells(0, 2).Text = "Description"
    fpSpread1.Sheets(0).ColumnHeader.Cells(0, 3).Text = "Tax?"
    fpSpread1.Sheets(0).ColumnHeader.Cells(0, 4).Text = "Cleared?"
    fpSpread1.Sheets(0).ColumnHeader.Cells(0, 5).Text = "Debit"
    fpSpread1.Sheets(0).ColumnHeader.Cells(0, 6).Text = "Credit"
    fpSpread1.Sheets(0).ColumnHeader.Cells(0, 7).Text = "Balance"
    ```
4. Now set up the column widths to properly display the headings and the data you will add. Add the following code below the code you added in Step 3:
    **Example**

    ```csharp
    // Set column widths.
    fpSpread1.Sheets[0].Columns[0].Width = 50;
    fpSpread1.Sheets[0].Columns[1].Width = 50;
    fpSpread1.Sheets[0].Columns[2].Width = 175;
    fpSpread1.Sheets[0].Columns[3].Width = 40;
    fpSpread1.Sheets[0].Columns[4].Width = 65;
    fpSpread1.Sheets[0].Columns[5].Width = 100;
    fpSpread1.Sheets[0].Columns[6].Width = 100;
    fpSpread1.Sheets[0].Columns[7].Width = 125;
    ```

    ```vbnet
    ' Set column widths.
    fpSpread1.Sheets(0).Columns(0).Width = 50
    fpSpread1.Sheets(0).Columns(1).Width = 50
    fpSpread1.Sheets(0).Columns(2).Width = 175
    fpSpread1.Sheets(0).Columns(3).Width = 40
    fpSpread1.Sheets(0).Columns(4).Width = 65
    fpSpread1.Sheets(0).Columns(5).Width = 100
    fpSpread1.Sheets(0).Columns(6).Width = 100
    fpSpread1.Sheets(0).Columns(7).Width = 125
    ```
5. Save your project, then click the **Start** button in the toolbar to run your project.
6. Your form should look similar to the following picture.

![Register with headings](https://cdn.mescius.io/document-site-files/images/2238e618-a1fb-45a6-9ce5-9a4157bd2931/images/checkbook1.png)

Go to [Setting the Cell Types of the Register](/spreadnet/docs/latest/online-win/overview/PowerTools_Help19/spwin-tutor-cbr/spwin-tutor-cbr-celltypes) to continue the tutorial.