In Excel, if the cell A1 has some value that gets formatted in a specific way, is there a way for cell B1 to reference the string displayed in A1?
To clarify:
Is something like this possible?
In fact, Excel stores datetime
as a number
, so you have to explicitly set format of the cell to see the proper value.
You may want to use TEXT
function, but anyway, you have to specify format
of output string:
=TEXT(A1,"hh:mm:ss")
Another option is to write your own VBA function, which can convert a value of a cell based on it's format:
Public Function GetString(ByVal cell As Range) As String
GetString = Format(cell, cell.NumberFormat)
End Function
This will give you a result based on source cell's format
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.