+ Reply to Thread
Results 1 to 3 of 3

Add-in to set column width and row height based on pixels in cell

  1. #1
    Forum Contributor CobraLAD's Avatar
    Join Date
    07-23-2007
    Location
    Boksburg, South Africa
    MS-Off Ver
    Office 2019
    Posts
    346

    Add-in to set column width and row height based on pixels in cell

    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.
    Name:  column & row pixel adjuster.png
Views: 4637
Size:  36.6 KB
    Last edited by 6StringJazzer; 02-27-2016 at 03:24 PM.
    Regards
    LAD

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Column width and row height

    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.
    Jeff
    | | |·| |·| |·| |·| | |:| | |·| |·|
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Contributor CobraLAD's Avatar
    Join Date
    07-23-2007
    Location
    Boksburg, South Africa
    MS-Off Ver
    Office 2019
    Posts
    346

    Re: Column width and row height

    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.
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Locking Column Width and Row Height
    By Zaraf in forum Excel General
    Replies: 7
    Last Post: 12-02-2013, 10:08 AM
  2. Replies: 3
    Last Post: 03-22-2013, 12:19 AM
  3. Setting column width and row height
    By meherts in forum Excel General
    Replies: 1
    Last Post: 07-16-2010, 11:05 AM
  4. auto fit column width and row height
    By kb in forum Excel General
    Replies: 0
    Last Post: 05-22-2006, 03:00 PM
  5. Row height/column width
    By Connie Martin in forum Excel General
    Replies: 1
    Last Post: 03-20-2006, 12:55 PM
  6. Column Width and Row Height
    By Pillow in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 12-13-2005, 12:00 PM
  7. [SOLVED] Row height & column width numbers..?
    By Frank in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 09-04-2005, 01:05 PM
  8. Displaying column width and row height
    By swirlygirl in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-07-2005, 06:06 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1