Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Delete only the fourth character
Hi,
I would like to have a macro that would delete only the fourth character into the selected cells Thanks Catherine |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Delete only the fourth character
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 "Catherine" wrote: Hi, I would like to have a macro that would delete only the fourth character into the selected cells Thanks Catherine |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Delete only the fourth character
Thanks Sam,
But I don't want to insert a new column into my workook "Sam Wilson" wrote: 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 "Catherine" wrote: Hi, I would like to have a macro that would delete only the fourth character into the selected cells Thanks Catherine |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Delete only the fourth character
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 "Catherine" wrote in message ... Thanks Sam, But I don't want to insert a new column into my workook "Sam Wilson" wrote: 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 "Catherine" wrote: Hi, I would like to have a macro that would delete only the fourth character into the selected cells Thanks Catherine |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Delete only the fourth character
It would be temporary - you could then paste the values of the new column
over the old column before deleting it. Sam "Catherine" wrote: Thanks Sam, But I don't want to insert a new column into my workook "Sam Wilson" wrote: 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 "Catherine" wrote: Hi, I would like to have a macro that would delete only the fourth character into the selected cells Thanks Catherine |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Delete only the fourth character
On Thu, 29 May 2008 08:35:02 -0700, Catherine
wrote: 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 |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
Delete only the fourth character
Thanks to everybody for your macro, it's working
Catherine "Ron Rosenfeld" wrote: On Thu, 29 May 2008 08:35:02 -0700, Catherine wrote: 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Delete special character | Excel Discussion (Misc queries) | |||
insert "-" as fourth character in number string | Excel Discussion (Misc queries) | |||
Delete everything after a certain character | Excel Programming | |||
Delete all occurrences of a character | New Users to Excel | |||
Delete everything after a certain character? | Excel Programming |