calculating two strings

S

sirron

I have a string that contains a number 10
and another string that contains a number 5
I want to add these together to get
a number 15
Does anyone know how this is done?

thanks sirron
 
T

Tom Ogilvy

Dim lngTotal as Long
Dim str1 as String, str2 as String
str1 = 10
str2 = 5
lngtotal = clng(str1) + clng(str2)
msgbox lngTotal
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top