Delete only the fourth character

  • Thread starter Thread starter Catherine
  • Start date Start date
C

Catherine

Hi,

I would like to have a macro that would delete only the fourth character
into the selected cells

Thanks
Catherine
 
You could just use existing excel formulas and then paste special as values?

put this in cell B2, and it takes the fourth character out of A1

=LEFT(A1,3)&RIGHT(A1,LEN(A1)-4)

Sam
 
Thanks Sam,

But I don't want to insert a new column into my workook
 
This macro will do what you want...

Sub DeleteFourthCharacter()
Dim Cel As Range
For Each Cel In Selection
Cel.Value = Left(Cel.Value, 3) & Mid(Cel.Value, 5)
Next
End Sub

Rick
 
It would be temporary - you could then paste the values of the new column
over the old column before deleting it.

Sam
 
Hi,

I would like to have a macro that would delete only the fourth character
into the selected cells

Thanks
Catherine


======================
Option Explicit
Sub Del4th()
Dim c As Range
For Each c In Selection
c.Value = Application.WorksheetFunction.Replace(c.Value, 4, 1, "")
Next c
End Sub
=========================
--ron
 

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