Option
Explicit
Sub
Beispiel01()
Dim
strZahl1
As
String
Dim
strZahl2
As
String
strZahl1 =
"123456"
strZahl2 =
"7890"
If
Len(strZahl1) < Len(strZahl2)
Then
strZahl1 = Format$(strZahl1,
String
$(Len(strZahl2),
"0"
))
ElseIf
Len(strZahl1) > Len(strZahl2)
Then
strZahl2 = Format$(strZahl2,
String
$(Len(strZahl1),
"0"
))
Else
End
If
Debug.Print
"strZahl1: "
& strZahl1
Debug.Print
"strZahl2: "
& strZahl2
End
Sub
Sub
Beispiel02()
Dim
strWert
As
String
strWert =
"1A"
Debug.Print strWert &
" (hex) -> "
& Val(
"&H"
& strWert) &
" (dec)"
strWert =
"2FE0"
Debug.Print strWert &
" (hex) -> "
& Val(
"&H"
& strWert) &
" (dec)"
strWert =
"1234"
Debug.Print strWert &
" (dec) -> "
& Hex$(strWert) &
" (hex)"
End
Sub
Sub
Beispiel03()
Dim
lngZahl1
As
Long
Dim
lngZahl2
As
Long
Dim
lngErg
As
Long
lngZahl1 = 150
lngZahl2 = 98
lngErg = lngZahl1
Or
lngZahl2
Debug.Print lngZahl1 &
" Or "
& lngZahl2 &
" -> "
& lngErg
lngErg = lngZahl1
And
lngZahl2
Debug.Print lngZahl1 &
" And "
& lngZahl2 &
" -> "
& lngErg
End
Sub