Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
I wish to delete 3 characters in each cell of a row. A macro qould be much
faster but how i do it? |
#2
![]() |
|||
|
|||
![]()
Hi Rick,
Try: '=================== Public SubDeleteLast3Chars() Dim rng As Range Dim rcell As Range Dim WB As Workbook Dim SH As Worksheet Dim iLen As Long Set WB = ActiveWorkbook '<<========== CHANGE Set SH = WB.Sheets("Sheet4") '<<========== CHANGE Set rng = SH.Range("A2:M2") '<<========== CHANGE For Each rcell In rng.Cells With rcell If Not .HasFormula Then If Not IsEmpty(.Value) Then iLen = Len(.Value) .Value = Left(.Value, iLen - 3) End If End If End With Next End Sub '<<=================== --- Regards, Norman "Rick" wrote in message ... I wish to delete 3 characters in each cell of a row. A macro qould be much faster but how i do it? |
#3
![]() |
|||
|
|||
![]()
Hi Rick,
Public SubDeleteLast3Chars() should read: Public Sub DeleteLast3Chars() (To rectify dropped space!) --- Regards, Norman "Norman Jones" wrote in message ... Hi Rick, Try: '=================== Public SubDeleteLast3Chars() Dim rng As Range Dim rcell As Range Dim WB As Workbook Dim SH As Worksheet Dim iLen As Long Set WB = ActiveWorkbook '<<========== CHANGE Set SH = WB.Sheets("Sheet4") '<<========== CHANGE Set rng = SH.Range("A2:M2") '<<========== CHANGE For Each rcell In rng.Cells With rcell If Not .HasFormula Then If Not IsEmpty(.Value) Then iLen = Len(.Value) .Value = Left(.Value, iLen - 3) End If End If End With Next End Sub '<<=================== --- Regards, Norman "Rick" wrote in message ... I wish to delete 3 characters in each cell of a row. A macro qould be much faster but how i do it? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
in cell editing macro | Excel Discussion (Misc queries) | |||
macro help | Excel Discussion (Misc queries) | |||
converting Lotus 123 macro to Excell macro | Excel Discussion (Misc queries) | |||
Relative Cell position NOT working with or without macro | Excel Discussion (Misc queries) | |||
Copy cell format to cell on another worksht and update automatical | Excel Worksheet Functions |