Hi community,
I have been working on a math drill program for a bit now. I had asked a similar question to this previously but I wasn't getting any good help with it. So I decided to research the problem more thoroughly and found something interesting.
Now before I begin, I just want to go over the preliminaries. Yes, I am using Microsoft Excel 2007. No, while this may work for you, it is not for me.
Okay now that, that is taken care of:
The problem I am having is when I have
ActiveCell.NumberFormat = "# ?/?"
in my my code it causes the excel's center line to be shifted to the left (that is the only way i know how to explain it).
Meaning, if you have something right justified, it will look centered, if it is centered it will be almost left justified and there is very little difference between left and center justified.
if i have
ActiveCell.NumberFormat = "?/?"
then there is none of the above problems.
The entire code of this section is as follows:
Sub test()
Sheets("sheet1").Select
Range("a1").Select
For i = 1 To 10
ActiveCell.NumberFormat = "# ?/?"
With ActiveCell
.Locked = False
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
End With
ActiveCell.Value = 33
ActiveCell.Offset(0, 1).Select
Next i
End Sub
Any suggestion or reason for why this is happening would be greatly appreciated. Ideally the user should be able to see a mixed number.
Further information, if I change each cell by hand to fraction then it works fine. it is only when excel does it.