# Pixels in Excel

Category: Geeks r Us

## Post 1 by purple penguin (Don't you hate it when someone answers their own questions? I do.) on Tuesday, 23-Mar-2010 22:49:59

Hi.
I'm trying to change the pixel width and height in Excel 2007, but the edit box gives a value based on the number of characters. How would you convert, say, 60 pixels into character values? Is there some kind of conversion chart or calculator for this?

## Post 2 by LeoGuardian (You mean there is something outside of this room with my computer in it?) on Wednesday, 24-Mar-2010 10:05:40

If memory serves me, you can use points to pixels calculator in your VB code. Now I haven't done that in Excel, but Powerpoint has a pointsToScreenPixels. Points, aka postscript points, are the unit of measure used to measure font size/weight. So, when you see 12 point font, that is 12 points high in postscript points. If you're using the Visual basic editor for VBA (Visual Basic for Applications), you may find a similar member function under Office, or Excel. I've never done anything but math / chart-related stuff in Excel. Make sure what's being said is characters is characters, and not points first.

## Post 3 by purple penguin (Don't you hate it when someone answers their own questions? I do.) on Monday, 29-Mar-2010 14:27:29

I had to get a sighted person to set the pixels, but sometimes it's hard to get someone who understands what they are doing. It's so much easier to auto fit than to try and figure it all out. some really smart programmer should come up with a characters to pixel converter.

## Post 4 by LeoGuardian (You mean there is something outside of this room with my computer in it?) on Monday, 29-Mar-2010 17:57:35

I'm surprised Excel's objects don't have one, but I see what you're saying, you're doing it as a user and not via automation.
The problem with converting characters to pixels is that there is nothing fixed about a single character. In other words, it's all in the points. When I have a chance I'll do some looking and see what keyboard shortcuts are available if there are some for moving the cell or resizing it. And yes, I frequently just space things out so the formatting is fine or select multiple cells to merge, in short manage the same scenario.
You will find this especially becomes convenient as a way to do things if you write complex formulas, because each cell is an in/out variable (by reference is the technical term), and you can even name a particular cell to later reference in a formula.