Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 07-06-2018, 08:43 PM
gmayor's Avatar
gmayor gmayor is offline Word VBA discussion Windows 10 Word VBA discussion Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,144
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

It will work if you tell the code what the values are or the instruction + becomes the default for combining text strings e.g.

Code:
Dim Sum As Long
Dim Sum2 As String
    'Sum = Val(TextBox1.value) + Val(TextBox2.value)
    'or
    Sum = CLng(TextBox1.value) + CLng(TextBox2.value)
    Sum2 = TextBox1.value + TextBox2.value
    MsgBox Sum & vbCr & Sum2
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
InfoPath - User Permissions & Shared Discussion rob171171 Misc 0 09-17-2013 05:14 AM
other forums with visio discussion Guy Roth Visio 1 05-23-2012 05:42 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:31 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft