Macros

  • Thread starter Thread starter Rick
  • Start date Start date
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
 
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
 
One way:

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

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

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

Similar Threads


Back
Top