LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Problem with a very simple code in Visual basic

Hi,

I'm beginning my studies with Visual Basic on my Excel 2003 and I have a
problem with calculations concerning adding. I will write the source and I
hope somebody could help me. The problem is that the calculation below gives
me a result 34 if A=3 and B=4. However if I try to multiply these numbers the
program gives me the right answer..

Sub Investments()
A = InputBox("Enter domestic investment amount")
B = InputBox("Enter foreign investment amount")
TotalInvestment = A + B
MsgBox "The total investment= " & TotalInvestment
End Sub

Regards
Vepa


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
A simple visual basic program wilchong via OfficeKB.com New Users to Excel 2 October 22nd 08 09:16 AM
Visual Basic code Pickle Excel Discussion (Misc queries) 1 September 4th 08 03:35 PM
I need a visual basic code....please Rhonda Excel Discussion (Misc queries) 1 March 5th 07 01:18 PM
Need code for Excel Simple Visual Basic Macro to select next avai. Marco Margaritelli[_3_] Excel Programming 6 November 2nd 04 10:26 PM
Visual Basic Code Robert Couchman Excel Programming 2 February 2nd 04 03:10 PM


All times are GMT +1. The time now is 03:33 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"