「VBA」文字列を数値にするサンプル

書式
CInt(値)
使用例

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
Sub funcA()
Dim x As String
x = "100"
resA = CInt(x)
Debug.Print (resA)
Debug.Print (VarType(resA))
End Sub
Sub funcA() Dim x As String x = "100" resA = CInt(x) Debug.Print (resA) Debug.Print (VarType(resA)) End Sub
Sub funcA()
    
    Dim x As String
    x = "100"
    
    resA = CInt(x)
    Debug.Print (resA) 
    Debug.Print (VarType(resA)) 
    
End Sub

 

VBScript

Posted by arkgame