簡體   English   中英

VBA UDF 返回單元格編號格式

[英]VBA UDF to return cell numberformat

我正在嘗試在 Excel 中創建一個 UDF,它返回單元格的數字格式(例如:數字、日期、百分比等...)

我試過了,但它什么也沒返回(空)

Function Getnumfo(rng As Range) As String
    Application.Volatile
    Dim str As String
    rng.NumberFormat = str
    Getnumfo = str
End Function

謝謝您的幫助 !

謝謝大本! 這行得通

Function Getnumfo(rng As Range) As String
    Application.Volatile
    Dim str As String
    str =rng.NumberFormat
    Getnumfo = str
End Function

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM