Option Explicit
Sub Add_A()
Dim Last, Z As Variant, X As Variant
Sheets("Sheet1").Select
{here add title of your sheet}
Last = ActiveCell.SpecialCells(xlLastCell).Address
ActiveSheet.Range(Cells(1, 1), Last).Select
Z = Selection.Address
{taking adress}
For Each X In ActiveSheet.Range(Z)
{working while...}
If Len(X) > 0 Then
{finding cell with content}
X.FormulaR1C1 = Chr(65) & X.Text
{65 is code for 'A'}
Else
X.FormulaR1C1 = ""
{change nothing if cell is empty }
End If
Next
End Sub
Save this like new Macro and run it. Macro "Add_A" will add "A" in front of cells content. You can change "A" with other characters to yield corresponding results.
0 comments:
Post a Comment