Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Rob wrote...
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) |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
similar to the technique used in the worksheet:
edition = Right(edition, Len(edition) - 4) -- Gary''s Student gsnu200702 "Rob" wrote: 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 |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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. Rob wrote: 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 -- Dave Peterson |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
THANK YOU SOOO VERY MUCH!!! That was the perfect solution that I was looking
for! Thanks Again, Cheers! Rob "Gary''s Student" wrote: similar to the technique used in the worksheet: edition = Right(edition, Len(edition) - 4) -- Gary''s Student gsnu200702 "Rob" wrote: 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Named Ranges - what characters are (or are not) allowed in the nam | Excel Discussion (Misc queries) | |||
How can I control the length of characters a code will return? | Excel Discussion (Misc queries) | |||
Formula to replace invalid filename characters | Excel Worksheet Functions | |||
Remove varying amounts of space characters | Excel Discussion (Misc queries) | |||
Help - Can't directly input Japanese characters into cell | Excel Discussion (Misc queries) |