Well, shucks, I was all happy to be able to do it without "looping"...oh well. Here you go:
Option Explicit
Sub ReformatData()
'JBeaucaire 3/12/2010
Dim LR As Long, Rw As Long, Shp As Shape
Dim MyKey As String, MyChn As String
Application.ScreenUpdating = False
MyKey = "CHAINAGE"
With ActiveSheet
LR = .Range("A" & .Rows.Count).End(xlUp).Row
Rw = Cells.Find(MyKey, After:=.[A3], LookIn:=xlValues, LookAt:=xlWhole).Row
Do
If UCase(Trim(Cells(Rw, "A"))) = "CHAINAGE" Then MyChn = "_" & Cells(Rw, "B")
If IsNumeric(Cells(Rw, "A")) And Cells(Rw, "A") > 0 Then Cells(Rw, "A") = Cells(Rw, "A") & MyChn
Rw = Rw + 1
Loop Until Rw > LR
End With
On Error Resume Next
Range("A1:A" & LR).SpecialCells(xlCellTypeBlanks).EntireRow.Delete xlShiftUp
Range("C1:C" & LR).SpecialCells(xlCellTypeBlanks).EntireRow.Delete xlShiftUp
Range("C1:C" & LR).SpecialCells(xlCellTypeConstants, 2).EntireRow.Delete xlShiftUp
Rows(1).Delete xlShiftUp
For Each Shp In ActiveSheet.Shapes
Shp.Delete
Next Shp
Application.ScreenUpdating = True
End Sub
Bookmarks