Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #6  
Old 11-06-2018, 05:05 AM
gmayor's Avatar
gmayor gmayor is offline vba add and subtract code Windows 10 vba add and subtract code 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

Change all the Variant variables to Long variables and it will work as you intend.
It would also have been preferable to have added your further question to your earlier post rather than start a new one.
To add code tags, select Go Advanced select the code and use the # button.
It is advisable to use Option Explicit to start your modules as this forces you to declare variables and makes errors easier to spot. You can set the VBA editor options to do this automatically.
__________________
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
 

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
subtract date and time and convert to decimal hours ? DBenz Excel 5 01-26-2017 05:38 AM
vba add and subtract code Subtract value if cell contains X term Jue92 Excel 4 11-01-2016 01:45 AM
Subtract value from one cell into another otuatail Excel 3 02-01-2016 03:21 AM
Use a numerical merge field to subtract that number of months MichaelSpedding Mail Merge 8 11-11-2015 01:11 PM
vba add and subtract code How to Subtract value in table, based on two different conditions nitemath2 Excel 1 06-19-2015 01:28 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:22 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