Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
Old 09-18-2006, 03:32 PM Excel macro help
Novice Talker

Posts: 7
Trades: 0
I need to write a macro that will take current cell content between "o/" and "/", remove hyphens and then add it to the end of the current cell contects. I know how to add text to the end of current cell contents, but cannot figure out how to do the rest. Any ideas?
meowsd is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 09-18-2006, 05:21 PM Re: Excel macro help
Extreme Talker

Posts: 246
Trades: 3
I don't know whether this helps or not, but here is a way to assign a formula to the cell immediately to the right of the cell with the content in it. Since you already know how to concatenate strings, I won't mess with doing that here. This formula will return everything between the "o/" and "/", with the hyphens removed:
Code:
    ActiveCell.FormulaR1C1 = "=SUBSTITUTE(MID(RC[-1],SEARCH(""o/"",RC[-1])+2,SEARCH(""/"",RC[-1],SEARCH(""o/"",RC[-1])+2)-(SEARCH(""o/"",RC[-1])+2)),""-"","""")"
There are probably better ways to do it all in the VBA code, but depending on how urgently you need this, you can throw this in a loop and get it done the "quick and dirty" way.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

Last edited by CouponGuy; 09-18-2006 at 06:34 PM..
CouponGuy is offline
Reply With Quote
View Public Profile
 
Old 09-18-2006, 06:32 PM Re: Excel macro help
Novice Talker

Posts: 7
Trades: 0
Thank you!
meowsd is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Excel macro help
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.11511 seconds with 12 queries