Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 83
Default Quick Help!!! - remove character at position "X"

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Quick Help!!! - remove character at position "X"

Steve,

You could simple enter a formula like this

=LEFT(A2,6)&MID(A2,8,LEN(A2))

into another column, copy down, then copy and paste values over the original. Either manually or
with a macro would be simple...

HTH,
Bernie
MS Excel MVP


"Stephen" wrote in message
...
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



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 83
Default Quick Help!!! - remove character at position "X"

Perfect, works like a charm!

Many Thanks!!!

"jabbott" wrote:

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

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Quick Help!!! - remove character at position "X"

Or a macro to do the same
Sub trimtosevenchar()
mc = "k"
On Error Resume Next
For i = 1 To Cells(Rows.Count, mc).End(xlUp).Row
Set myc = Cells(i, mc)
If Len(myc) 6 Then myc.Value = Left(myc, 6) & Mid(myc, Len(myc))
Next
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Bernie Deitrick" <deitbe @ consumer dot org wrote in message
...
Steve,

You could simple enter a formula like this

=LEFT(A2,6)&MID(A2,8,LEN(A2))

into another column, copy down, then copy and paste values over the
original. Either manually or with a macro would be simple...

HTH,
Bernie
MS Excel MVP


"Stephen" wrote in message
...
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






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Quick Help!!! - remove character at position "X"

You could simple enter a formula like this

=LEFT(A2,6)&MID(A2,8,LEN(A2))

into another column, copy down, then copy and paste values over the
original.
Either manually or with a macro would be simple...


Another possibility...

=REPLACE(A2,7,1,"")

Rick

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
=SUBSTITUTE(C4,"~?#","") will this work to remove multiple string Raja Mahendiran S Excel Worksheet Functions 6 May 12th 10 09:10 PM
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
Change "-" from right first character to left first character to make a negative amount [email protected][_2_] Excel Programming 2 July 27th 07 03:54 PM
Remove space and "-" character thanhnguyen[_21_] Excel Programming 4 July 5th 06 04:48 AM
remove last character in a column of part numbers if a "V" leo Excel Discussion (Misc queries) 3 January 18th 06 05:07 PM


All times are GMT +1. The time now is 04:21 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"