-3

I have been trying to append ' before a value so that excel cells will recognize the cells as a text value. Is there any way we can append ' with a value from UDF.

e.g If I call GetZero() it will return me '0.00 and excel will recognize it as 0.00 only(but as a text value).

Pᴇʜ
  • 56,719
  • 10
  • 49
  • 73
Sourabh Mishra
  • 212
  • 1
  • 10

1 Answers1

0

For your example

Public Function GetZero() As String
GetZero = "'" & format(0,"0.00")
End Function
Harassed Dad
  • 4,669
  • 1
  • 10
  • 12
  • I am trying this on C#. Once i set the value as: `GetZero = "'0.000" ` it returns '0.000 which is the not the expected value. What i an trying to achieve is to get value as 0.000 so that i can apply +/-/* operations. Like $C$1 + 24. – Sourabh Mishra Oct 15 '19 at 06:16