A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
If you want to manage multiple cells in the Change event, cut off all unused cells and use a FOR EACH loop to get each cell from the Target.
Andreas.
Sub Worksheet_Change(ByVal Target As Range)
Dim R As Range
'Act only in the used range of this sheet
Set Target = Intersect(Target, Target.Parent.UsedRange)
'Finish if out of this range
If Target Is Nothing Then Exit Sub
Application.EnableEvents = False
'Visit each cell
For Each R In Target
Select Case R.Column
Case 3
If R.Value < 1 Then
R.NumberFormat = "0.00%"
R.Offset(0, 1) = "Percentage"
Else
R.NumberFormat = "0.00"
R.Offset(0, 1) = "Dollar"
End If
Case 4
If R.Offset(0, -1) = 0 Then
R = "Percent"
Else
If Left(R.Value, 1) = "D" Then
If R.Offset(0, -1) < 1 Then R.Offset(0, -1) = R.Offset(0, -1) * 100
R.Offset(0, -1).NumberFormat = "0.00"
Else
If R.Offset(0, -1) >= 1 Then R.Offset(0, -1) = R.Offset(0, -1) * 0.01
R.Offset(0, -1).NumberFormat = "0.00%"
End If
End If
End Select
Next
Application.EnableEvents = True
End Sub