PDA

View Full Version : Need Help 2 Find First Few Letters and Move 'em!



MurcksPoms
12-13-2007, 04:15 PM
Hi again!!
There was a post that almost answered my question, but here it is... I have a list of names in column A. Some start with CH <(there is a space after that, in case the dog's name starts with "ch" like Cherokee or something). If that dog's name starts with CH I need Excel to move the CH to another column, say column G. That way in column A the name CH Castile's Southern Comfort would only be Castile's Southern Comfort and in column G there would be a nice little CH, (space not ness. here).
Thanks in advanced!!! Jennifer

Also, in case you guys needed the whole sheet, here it is...
7508

It is on the 2nd Tab, I think it is "FormatWeb"

^^^I just looked and it might be easier to do it on the first tab, on column G. I can always look it up from the format web page, so either way I guess!

Bob Phillips
12-13-2007, 04:28 PM
Public Sub ProcessData()
Dim i As Long
Dim LastItem As Long

With ActiveSheet

Application.ScreenUpdating = False
LastItem = .Cells(.Rows.Count, "A").End(xlUp).Row
For i = 1 To LastItem
If Left$(.Cells(i, "A").Value, 3) = "CH " Then
Cells(i, "A").Value = Replace(Cells(i, "A").Value, "CH ", "")
.Cells(i, "G").Value = "CH "
End If
Next i
Application.ScreenUpdating = True
End With

End Sub

MurcksPoms
12-13-2007, 07:56 PM
Thank you so much, you guys are genius! Way to go!!

A million thanks!!!!!