I have a macro for sizing a spreadsheet rows and columns precisely in cm. It works like a charm.
My point is that as soon as I fill in the cells with data, the cells columns get resized by the application at the run time (rows size keeps unchanged).
I tried to swap the 2 portions of codes, eg. sizing then filling up with data, and reverse. I get the same result in both cases, e.g. the columns get resized, which I don't want.
I also tried this code below, inserted after having sized the cells and before filling them with data, but this leads to an application error when the code tries to fill in the first data, as I guess it requires to resize the column :
With oWs
.Range("A:Z").ShrinkToFit = True
.Protect "", AllowFormattingRows:=False, AllowFormattingColumns:=False
End With
The code for width and height sizing is coming from microsoft support.
That's like chicken and egg headhache.
Thx for any workaround.