How can I, without using formulas, show integers as integers, but decimals limited to a specific number of decimal places.
e.g. show:
1
as 1
Maybe an example used to put coordinates to a point could help.
Sub PutCoord(PtN&, Px#, Py#, S4$)
Px = Round(Px, 2): Py = Round(Py, 2)
Dim XS$: If Px = Int(Px) Then XS = Format(Px, "0") Else XS = Format(Px, "0.##")
Dim YS$: If Py = Int(Py) Then YS = Format(Py, "0") Else YS = Format(Py, "0.##")
Dim WS$: WS = "Pt " & PtN & " @ " & XS & " , " & YS
With ActiveSheet.Shapes.AddShape(msoShapeDoubleBracket, Px, Py, 90, 20)
With .TextFrame
.MarginLeft = 0
.MarginRight = 0
.MarginTop = 0
.MarginBottom = 0
.Characters.Text = WS
.AutoSize = msoAutoSizeShapeToFitText
End With
.Name = S4 & PtN
End With
End Sub