View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Substring to replace string

activeCell.Value = Left(activeCell.Value,5)

--
Regards,
Tom Ogilvy

"Andrew Slentz" wrote in message
...
Hi,

I am trying to figure out an easy way to create an excel macro that will
take a substring and replace the string with that substring. Ex:
47130-5240 (original) take the first 5 characters and replace the
original value with only those first 5 characters. So the result would
be 47130 in that cell.

Any ideas???

Thanks,

Andrew

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!