Excel: cell size that changes depending on the PC?

warstick -  
eriiic Posted messages 24581 Registration date   Status Contributor Last intervention   -
Hello,

I'm facing a bit of a strange problem...
I created an Excel file on one PC where the row height of the cells is set to 14.3 and the column width is set to 1.93. The cells are therefore perfectly square.
I copy this file to a second different PC, and when I open it, the cell sizes are changed!
The height goes to 15 and the column width to 1.86! The cells are no longer square, and this distorts the shapes drawn on the sheet.
How is this possible? And how can I fix it? For example, by locking the cell dimensions, but how do I do that? I tried protecting the sheet, but that still has no effect; the size always varies from one PC to another.

Thank you.

4 answers

eriiic Posted messages 24581 Registration date   Status Contributor Last intervention   7 281
 
Hello,

we can assume that it depends on the screen resolution, which is different.
The displayed size depends on the pixel density and varies from one to another.
eric

--
By trying continuously, we eventually succeed.
So the more it fails, the more chances we have that it works. (the Shadoks)
In addition to saying thank you (yes, it can be done!!!), remember to set it to resolved. Thank you.
0
warstick
 
Both PCs have different resolutions indeed. But I don't really see the connection, as what matters are the dimensions of the cells mainly to maintain the aspect ratio. Do I have to reset the exact dimensions every time I open it on a different PC? Not very practical…
And surprising that Microsoft didn't think of that?
0
eriiic Posted messages 24581 Registration date   Status Contributor Last intervention   7 281
 
The report is that on a monitor you use whole pixels.
If on one monitor it is 0.15 and 0.16 on the other, you can see that this creates a gap that will widen with distance.
There's hardly any other solution than to have monitors with the same characteristics.
Calculating the adjustment to be made through a macro according to these is quite complex. Have fun doing a Google search about it.
eric

By continually trying, we eventually succeed.
So the more it fails, the more chances we have that it works. (the Shadoks)
In addition to the thank you (yes, yes, it happens!!!), remember to put it as resolved. Thank you.
0
warstick
 
No, no need for calculations. When I open the file on the second PC, I just have to re-enter the same values as before, like on the first PC, so height=14.3 and width=1.93, and I get my cells exactly how I want. Is there no way for these values to remain fixed, simply?
0
f894009 Posted messages 17417 Registration date   Status Member Last intervention   1 717
 
Hello,

do values remain fixed simply?
If by using VBA code upon opening the file

An example of code:

Sub test() 'height=14.3 and width=1.93 Columns("A:A").ColumnWidth = 1.93 Rows("1:1").RowHeight = 14.3 End Sub
0
warstick
 
Sure, thank you.
However, I don't know anything at all about VBA code, how and where to integrate it into my file? Thank you.
0
f894009 Posted messages 17417 Registration date   Status Member Last intervention   1 717 > warstick
 
Hello,



Open your file
Alt+F11 to open the VBA window
double click on ThisWorkbook at the top left
A window opens on the right
Paste this code, adjusting as you wish:
Private Sub Workbook_Open() 'height=14.3 and width=1.93 With Worksheets("my sheet") 'adapt the range of columns .Columns("A:A").ColumnWidth = 1.93 .Rows("1:1").RowHeight = 14.3 End With End Sub

Save as xlsm not xlsx
0
warstick > f894009 Posted messages 17417 Registration date   Status Member Last intervention  
 
Thank you.
I will ultimately give up on the idea because it doesn’t solve my problem; it’s more serious than that. In fact, if I perfectly adjust the cells on my sheet, the print preview (and thus the printing) is distorted. I am therefore forced to readjust my cells. I don’t know why there is a difference between my Excel sheet and the print preview!
0
eriiic Posted messages 24581 Registration date   Status Contributor Last intervention   7 281 > warstick
 
Hello,

it always does that with Excel, it's not a real WYSIWYG.
You have to print a test page and adjust accordingly.
And start over if you change printers because the result will be different.
The same goes for a monitor change.
eric
0
eriiic Posted messages 24581 Registration date   Status Contributor Last intervention   7 281
 
For me, it's that Excel puts the possible approximate values according to the monitor.

--
By continuously trying, we eventually succeed.
So the more it fails, the more chances we have that it will work. (the Shadoks)
In addition to the thank you (yes, yes, it happens!!!), remember to set it to resolved. Thank you.
0
warstick
 
Yes, alright, but how do you set the values so they don't change from one PC to another?
0