View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
jabbott jabbott is offline
external usenet poster
 
Posts: 3
Default Quick Help!!! - remove character at position "X"

Sub Remove7thCharacter()
Dim t_Range As Excel.Range
Dim t_Col As Long
Dim t_Rows As Long

On Error GoTo Quit
Set t_Range = ActiveWindow.Selection
t_Col = t_Range.Rows.Column
t_Rows = (ActiveSheet.UsedRange.Rows.Count + ActiveSheet.UsedRange.Row -
1)

For r = ActiveSheet.UsedRange.Row To t_Rows
t_text = ActiveSheet.Cells(r, t_Col).Text

If Len(t_text) 6 Then
t_text = Left(t_text, 6) + Mid(t_text, 8)
ActiveSheet.Cells(r, t_Col) = t_text
End If
Next
Quit:
End Sub

"Stephen" wrote:

hi Folks,

I'm in desperate need of a macro that will traverse down an entire column
and remove the seventh character...
12345678, will become
1234568

TIA!!!

Steve