VBA Express Forum  




Go Back   VBA Express Forum > VBA Code & Other Help > Excel Help
     Feedback     
Register FAQ Members Arcade Knowledge Base Training Articles Consulting

Reply
 
Thread Tools Display Modes
Old 05-01-2012, 08:27 AM   #1
omp001

 
Joined: Aug 2011
Posts: 76
Kb Entries: 0
Articles: 0
Solved: Sum 'A' if there's any digit into string in 'B'

Hi all.

.A......... B
10.....123 ab
20.....123ab
30.....ab 123
40.....ab123
50.....123
60.....ab

I need to sum values from column 'A' if same row in 'B' there's some digit.
So, in e.g. above the result would be 10+20+30+40+50=150

Thanks in advance.


Regards
Osvaldo

Local Time: 03:35 AM
Local Date: 05-19-2013
Location:

 
Reply With Quote Top
Old 05-01-2012, 09:14 AM   #2
nilem

 
Joined: Nov 2011
Posts: 39
Kb Entries: 0
Articles: 0
UDF
VBA:
Function NumStr#(rSum As Range, rCheck As Range) Dim i&, smm# If rSum.Count <> rCheck.Count Then Exit Function For i = 1 To rSum.Count If rCheck(i, 1) Like "*[0-9]*" Then smm = smm + rSum(i, 1) Next i NumStr = smm End Function
VBA tags courtesy of www.thecodenet.com
Attached Files To view attachments your post count must be 0 or greater. Your post count is 0 momentarily.

Local Time: 12:35 PM
Local Date: 05-19-2013
Location:

 
Reply With Quote Top
Old 05-01-2012, 12:28 PM   #3
omp001

 
Joined: Aug 2011
Posts: 76
Kb Entries: 0
Articles: 0
Hi nilem.
Works nicely.
Thanks for your attention and for your time.


Regards
Osvaldo

Local Time: 03:35 AM
Local Date: 05-19-2013
Location:

 
Reply With Quote Top
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -7. The time now is 11:35 PM.


Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Copyright © 2004 - 2012 VBA Express