Jul 19, 2001 #1 ds2728 Programmer Jul 18, 2001 50 US Hello, I would like to execute the contents of a variable within my code. simple example is: counter= 10 newvar = "counter + 5" how do I get newvar to equal 15. thanks, dave
Hello, I would like to execute the contents of a variable within my code. simple example is: counter= 10 newvar = "counter + 5" how do I get newvar to equal 15. thanks, dave
Jul 19, 2001 #2 Guest_imported New member Jan 1, 1970 0 Lose the quotes... Sub test() Dim counter as Long Dim lngNewVar as Long lngCounter = 10 lngNewVar = lngCounter + 5 MsgBox lngNewVar 'Returns 15 End Sub Upvote 0 Downvote
Lose the quotes... Sub test() Dim counter as Long Dim lngNewVar as Long lngCounter = 10 lngNewVar = lngCounter + 5 MsgBox lngNewVar 'Returns 15 End Sub