Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

vba (isolate a nmber like 169-428)

Status
Not open for further replies.

vbaneedhelp

Technical User
Sep 16, 2003
2
US
Hi, I am using excel 2000 VBA.

I have this for ex. :

169-428

I would like to isolate 169 from 428, then I like to divid the 428 to 8 which comes to 53.5 then I like to add 169 to 53.5 and post the result 222.5 in A1 Cell. I hope someone help me.



Thx
 
You can use a formula for this, instead of using VBA code. If, for example 169-428 was in cell D2, you could use this:

Code:
=IF(ISERR(FIND("-",D2)),"Can't compute",MID(D2,1,FIND("-",D2)-1)+RIGHT(D2,LEN(D2)-FIND("-",D2))/8)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top