Need to add character before leading zero in a field
Try something like this:
Will concatenate a "X" to all selected cells. Excludes cells with formulas
and empty cells. Change "X" to whatever character you want.
Sub AddX()
Dim cell As Range
For Each cell In Selection.SpecialCells(xlCellTypeConstants)
cell.Value = "X" & cell.Value
Next cell
End Sub
Select the cells where you want this to happen and rum the macro.
--
Biff
Microsoft Excel MVP
"Melin" wrote in message
...
I need an automated way to add a character before a leading zero in a
field.
I am importing information into excel from one software, manipulating the
information so I have only what I need and then exporting the information
into another software. We created a macro to keep the leading zero in
Excel
but the software we are importing the information into does not allow
leading
zeros. =( So we have to add a character to before the leading zero.
I am currently using Excel 2003. Any help would be appreciated.
|