Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #8  
Old 05-22-2017, 03:45 AM
Guessed's Avatar
Guessed Guessed is offline Add only first numbers in each cell Windows 10 Add only first numbers in each cell Office 2013
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,176
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

In that case, try this macro after selecting the cells you want totalled
Code:
Sub CountNums()
  Dim lngCount As Long: lngCount = 0
  Dim oRng As Range
  For Each oRng In Selection.Areas(1)
    lngCount = lngCount + Split(oRng.Value, " ")(0)
  Next oRng
  MsgBox "The first numbers add up to: " & lngCount
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Add only first numbers in each cell Sorting numbers within cell michaelst Excel 9 04-22-2017 10:51 PM
Difference between 2 numbers in same cell Neila1982 Excel 1 02-12-2017 01:40 AM
Add only first numbers in each cell Add Numbers from One or Another Cell Kilch Excel 3 01-31-2017 12:55 PM
Search a cell that contains words and numbers and convert the numbers to metric Carchee Excel Programming 36 10-08-2014 03:16 PM
Add only first numbers in each cell adding numbers in same cell jetdude68 Word Tables 1 07-20-2010 12:30 AM

Other Forums: Access Forums

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