Simple macro help

J

Joe

Hi Folks

I have the following macro that cuts the front 6 characters out of a cell and pastes that data in another cell. I have tried but can't modify it to cut the last 5 characters from a cell and paste them in another cell. I swear I'm missing something really easy here. All help much appreicated.

Sub MoveAround()

Dim CellVal As String

CellVal = ActiveCell.Text
Range(ActiveCell.Address) = Right(CellVal, Len(CellVal) - 6)
ActiveCell.Offset(0, 1).Select
Range(ActiveCell.Address) = Left(CellVal, 6)
ActiveCell.Offset(1, -1).Select

End Sub
 
F

Frank Kabel

Hi
try
sub move_it2()
dim rng as range
set rng = activecell
with rng
.offset(0,1).value=right(rng.value,5)
.value = left(.value,len(.value)-5)
end with
end sub
 
Top