# Off Topic > Tips and Tutorials >  >  Add-in to set column width and row height based on pixels in cell

## CobraLAD

Hi everybody

I created a simple formula to work out the character column width from the pixel value for example 64 pixel = 8.43 character. I also built an add-in to adjust the width and height by using the pixel value. I would like to share this.
Must I put the formula in the Excel Formulas & Functions section and the add-in in the Excel Programming / VBA / Macros section, or can I put it in one post somewhere.

Screenshot of add-in.

----------


## 6StringJazzer

I have moved your thread to the appropriate place for tips, since you are not asking a question. You can add your add-in in this thread.

----------


## CobraLAD

I would like share this. I put together a simple formula to work out the character width and height from the pixel value.

-	Columns
Lets use the default pixel column width which is 64. If you type 64 in A1, then you enter in B1, *=A1/96*72* or *=A1/1.333333333* to get the cell width which is 48. With the column width in character size you need to be aware that the pixel width between 1 and 11 has a different character width than from 13 to 1789 (maximum width in pixel). Pixel width 12s character width is 1. So from 1 to 11 is simply the pixel value divided by 12, *=ROUND(A1/12,2)* (pixel width is always 2 digits if the value is not a whole value). From 13  1789 is (pixel value minus 12) divided by 7 plus 1, *=ROUND((A1-12)/7+1,2)*.
Then you combine them in one cell. So in C1 you can type
*=IF(A1<13,ROUND(A1/12,2),ROUND((A1-12)/7+1,2))*
For pixel value 12 you can use any of the 2 options and it will give you the same character value.

-	Rows
Rows are much easier and use only one formula. Cell height & row height is the same.
Lets use the default pixel row height which is 20. If you type 20 in A2, then you enter in B2, *=A2/96*72* or *=A2/1.333333333* to get the cell width which is 15 and it is also the row heights character size
Row height is from 1 to 546.

I built an add-in that you can adjust width and height using the pixel value. File is attached. It will load in the Home tab after the Cell group.

----------

