delete last character

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

Can someone please help me with some VBA to loop through a range, deleteing the last character from every cell

Thanks in advance.
 
Hi Therese
try the following macro (processes the current selection

sub delete_last()
dim rng as range
dim cell as range
set rng = selection
for each cell in rng
if len(cell.value>1) then
cell.value = left(cell.value,len(cell.value)-1)
end if
next
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

Back
Top