ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   calculating two strings (https://www.excelbanter.com/excel-programming/278871-calculating-two-strings.html)

sirron

calculating two strings
 
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

Tom Ogilvy

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

--
Regards,
Tom Ogilvy


"sirron" wrote in message
...
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





All times are GMT +1. The time now is 11:54 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com