Stripping The First Four Characters from a value

R

Rob

Hi,
What I am trying to figure out is how I can remove the first four characters
via a VBA Macro from a value of a cell.

Here's the example...

Edition = ActiveCell.FormulaR1C1 (this returns a value of "Rev XA" or "Rev
-" or "Rev 2")

What I want the macro to do is strip the "Rev " and just keep everything
from the fifth character on so I get (XA or - or 2)

Any Ideas??

Thanks In Advance,
Rob
 
H

Harlan Grove

Rob said:
What I am trying to figure out is how I can remove the first four characters
via a VBA Macro from a value of a cell.
....

Try

somecell.Value = Mid(somecell.Value, 5)
 
G

Gary''s Student

similar to the technique used in the worksheet:

edition = Right(edition, Len(edition) - 4)
 
D

Dave Peterson

If all your data to fix is in the same column, you could record a macro when you
select that range.

Then Data|Text to columns
Fixed width
draw a line between the 4th and 5th character (and no other lines)
and skip (do not import) that first field.

With lots of data, I would bet that this would be faster than looping through
the range.
 
R

Rob

THANK YOU SOOO VERY MUCH!!! That was the perfect solution that I was looking
for!

Thanks Again,
Cheers!
Rob
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top