Try it this way to compensate for any blanks and inadvertent touching of the
dreaded space bar
Sub macro2SAS()
Dim k As Range
Set k = Application.InputBox(Prompt:= _
"Please select the range", _
Title:="Specify range", Type:=8)
On Error Resume Next
If k Is Nothing Then
Exit Sub
Else
For Each cell In k
If Len(Application.Trim(cell)) > 0 Then
cell.Value = Abs(cell.Value)
End If
Next cell
End If
End Sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(E-Mail Removed)
"Mateen.jazz" <(E-Mail Removed)> wrote in message
news:1A1F45C3-A6F1-42B2-B461-(E-Mail Removed)...
> 'If u are looking for a macro to do that below is the code
> but be aware it converts blank to zero
> Sub macro2()
> Dim k As Range
> Set k = Application.InputBox(Prompt:="Please select the range",
> Title:="Specify range", Type:=8)
> On Error Resume Next
> If k Is Nothing Then
> Exit Sub
> Else
> For Each cell In k
> cell.Value = -cell.Value
> Next cell
> End If
> End Sub