Macros

R

Rick

I am attempting to create a macro that will count 6
characters, in a cell, from the right hand side and delete
the remaining characters.

Could some one assist me with this?

Thank you,

Rick
 
F

Frank Kabel

Hi Rick
try something like the following
sub foo()
dim cell as range
for each cell in selection
if cell.value<>"" then
cell.value = right(cell.value,6)
end if
next
end sub
 
J

JE McGimpsey

One way:

Assuming "the remaining characters" mean those on the left:

Public Sub RightSix()
With ActiveCell
.Value = Right(.Value, 6)
End With
End Sub
 
Top