Running Macros

  • Thread starter Thread starter Patrick.Killela
  • Start date Start date
P

Patrick.Killela

I am running a macro within excel

Sub change_to_Up()
Dim rr As Range
For Each rr In Selection
If rr.Value > 2 Then
rr.Value = "Up"
End If
Next rr
End Sub

Is there any way to edit this macro so that vales between 1 and 2 are
replaced with "Up"?


Many Thanks
 
Sub change_to_Up()
Dim rr As Range
For Each rr In Selection
If rr.Value > 1 _
and rr.value < 2 Then
rr.Value = "Up"
End If
Next rr
End Sub

You may want >= and <= at the edges (1 and 2).
 
Back
Top