PRODUCT : Quattro Pro NUMBER : 589 VERSION : All OS : PC DOS DATE : March 15, 1991 PAGE : 1/3 TITLE : Centering a Title on a Block of Cells Quattro Pro allows text to be centered within a cell but not within a range of cells. The following formula provides a means for centering a text string over any block of cells. ================================================================= @REPEAT(" ",@CELL("rwidth",Blockname)/2.0-@LENGTH("Your Title")/2)&"Your Title" ================================================================= THE BASIC PROCEDURE o The formula must be entered in one cell. o The only space in the formula is between the quotes at the beginning of the formula. This space pads the beginning of the text string so that it will be centered. o Blockname in this formula can be replaced with any cell or block, a block name, or any function that returns a block. This block of cells defines the range over which the text will be centered. o Replace the text Your Title with the text to be centered. o The value 2.0 may need to be adjusted to compensate for different fonts, point sizes, use of a Left Heading, or the Print To Fit feature (only in Quattro Pro v3.0) when printing. Increasing this value (e.g., 2.2, 2.8, etc.) will shift the title toward the left; decreasing it (e.g., 1.3, 1.6, etc.) will shift the title toward the right. PRODUCT : Quattro Pro NUMBER : 589 VERSION : All OS : PC DOS DATE : March 15, 1991 PAGE : 2/3 TITLE : Centering a Title on a Block of Cells MODIFYING THE FORMULA The formula can be modified to increase its flexibility by storing the arguments in separate cells and referencing those cells within the formula. 1. Defining the text of the title to be centered. Store Your Title (omitting the quote marks) in cell T3, for example, and reference this cell in the formula. Example: @REPEAT(" ",@CELL("rwidth",Blockname)/2.0-@LENGTH(T3)/2)&T3 2. Defining the block over which the title is to be centered. Use specific cell coordinates of the block, such as B25..H98, over which the title is to be centered. Example: @REPEAT(" ",@CELL("rwidth",B25..H98)/2.0-@LENGTH("Your Title")/2)&"Your Title" Use a name which has been assigned to a specific block of cells through , such as JulySales. Example: @REPEAT(" ",@CELL("rwidth",JulySales)/2.0-@LENGTH("Your Title")/2)&"Your Title" PRODUCT : Quattro Pro NUMBER : 589 VERSION : All OS : PC DOS DATE : March 15, 1991 PAGE : 3/3 TITLE : Centering a Title on a Block of Cells Use a function which returns a block. For example, the function @CURVALUE("print","block") finds the block currently defined in . Store this function in cell T2, then use the @@ function with T2 to return its value. Example: @REPEAT(" ",@CELL("rwidth",@@(T2))/2.0-@LENGTH("Your Title")/2)&"Your Title" 3. Determining the width of the block. The function @CELL("rwidth",block) returns number of characters in block's width. After choosing one of the methods above for defining the block, store the @CELL function in cell T1, for example, and the title centering formula becomes: @REPEAT(" ",T1/2.0-@LENGTH("Your Title")/2)&"Your Title" FINE TUNING This formula will return ERR if the block has not been defined. Define the block and press F9 to recalculate the formula. If the block size has been changed, the title will not automatically reposition itself. Again, press F9 to recalculate the formula. Use Quattro Pro's Screen Preview feature to check the position of the title. Remember, the title will be centered over the entire block. If, for example, the block is 12 columns wide and prints on two pages, the title will be positioned near the right edge of the first page because it is being centered over all 12 columns, not just the columns on the first page. If the title is to be centered on the first page only or over a print block plus Left Headings (columns defined as a Left Heading are not included when calculating the width of the print block), adjust the formula to move the title toward the left.