I would recommned using a formula
=IF(TRIM(A1)="","",IF(OR(A1=0.1,A1=0.2,A1=0.5),"FLAT",IF(OR(A1=2,A1=5),"PER","")))
But since you mentioned in comments
so if this is <= 1 then the answer is FLAT so if this is greater than 1 then the answer is PER – Kate Sayson 16 mins ago
So the above will change to
=IF(TRIM(A1)="","",IF(A1<1,"FLAT",IF(A1>=1,"PER","")))
Other alternative is to use the worksheet change event. This will only act when a value in Column A changes and will only update Column B. So your rest of the worksheet is safe.
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim aCell As Range
On Error GoTo Whoa
Application.EnableEvents = False
If Not Intersect(Target, Columns(1)) Is Nothing Then
For Each aCell In Target
If IsNumeric(aCell.Value2) And _
Len(Trim(aCell.Value2)) <> 0 And _
aCell.Column = 1 Then
Select Case aCell.Value2
Case Is < 1: Range("B" & aCell.Row).Value = "FLAT"
Case Else: Range("B" & aCell.Row).Value = "PER"
End Select
End If
Next
End If
Letscontinue:
Application.EnableEvents = True
Exit Sub
Whoa:
MsgBox Err.Description
Resume Letscontinue
End Sub
If you still want a macro then try this
Option Explicit
Sub Sample()
Dim ws As Worksheet
Dim lRow As Long
Dim i As Long
'~~> Change this to the relevant sheet
Set ws = Sheet1
With ws
'~~> Find last row in Col A
lRow = .Range("A" & .Rows.Count).End(xlUp).Row
'~~> Loop through relevant cells in Col A
For i = 1 To lRow
If IsNumeric(.Range("A" & i).Value2) And _
Len(Trim(.Range("A" & i).Value2)) <> 0 Then
Select Case .Range("A" & i).Value2
Case Is < 1: Range("B" & i).Value = "FLAT"
Case Else: Range("B" & i).Value = "PER"
End Select
End If
Next i
End With
End Sub