J
jcr
Hi:
I am having trouble dynamically setting a variable. The following
code does not work. Any ideas would greatly be appreciated.
Thanks,
Jim
Dim astr As String
Dim bstr As String
Dim myval As Double
Dim te As Double
Dim AAA As Object
astr = "test"
bstr = "test"
If astr = bstr Then
'want to set variable te (which is double) = 333.3
' AAA = CType(astr, ValueType)
AAA = Mid(bstr, 1, 2)
' Mid(bstr, 1, 2) = 333.3
AAA = 333.3
End If
te = te + 1
'variable te should now be set to 334.3
I am having trouble dynamically setting a variable. The following
code does not work. Any ideas would greatly be appreciated.
Thanks,
Jim
Dim astr As String
Dim bstr As String
Dim myval As Double
Dim te As Double
Dim AAA As Object
astr = "test"
bstr = "test"
If astr = bstr Then
'want to set variable te (which is double) = 333.3
' AAA = CType(astr, ValueType)
AAA = Mid(bstr, 1, 2)
' Mid(bstr, 1, 2) = 333.3
AAA = 333.3
End If
te = te + 1
'variable te should now be set to 334.3