Skip to content Skip to sidebar Skip to footer

Menentukan Tipe Data Pada Excel Secara Otomatis Menggunakan VBA

Bagaimana menentukan tipe data secara otomatis pada excel? gunakan source code berikut ini untuk membuat fungsi baru menggunakan visual basic for application (VBA)



Function CellType(pRange As Range)
'Updateby20140625
Application.Volatile
Set pRange = pRange.Range("A1")
Select Case True
    Case VBA.IsEmpty(pRange): CellType = "Blank"
    Case Application.IsText(pRange): CellType = "Text"
    Case Application.IsLogical(pRange): CellType = "Logical"
    Case Application.IsErr(pRange): CellType = "Error"
    Case VBA.IsDate(pRange): CellType = "Date"
    Case VBA.InStr(1, pRange.Text, ":") <> 0: CellType = "Time"
    Case VBA.IsNumeric(pRange): CellType = "Value"
End Select
End Function



Ini videonya di Youtube


Post a Comment for "Menentukan Tipe Data Pada Excel Secara Otomatis Menggunakan VBA "