PDA

View Full Version : Solved: adding a prefix letter



Blackie50
11-10-2011, 05:06 AM
Hi

I have a data file which varies in size each day.

Would like to add the letter "A" as a prefix to any cells in column D that aren't empty

Any help with the code would be appreciated

thanks
Jon

Blackie50
11-10-2011, 05:19 AM
Sub addA()
Dim cel As Range, cel1 As Range
For Each cel In Range(Cells(1, 4), Cells(Rows.Count, 4).End(xlUp))
If cel.Value > 0 Then

cel.Value = "A" + cel.Value

End If
Next
End Sub