View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
GKeramidas GKeramidas is offline
external usenet poster
 
Posts: 38
Default Clearing Non-numerical CellCvalues

try this and see if it works for you


Sub test()
Dim cell As Range
For Each cell In Range("D9:DP496")
If IsNumeric(cell.Value) Then
cell.Value = cell.Value
Else
cell.Value = ""
End If
Next
End Sub

--


Gary


"alistre" wrote in message
oups.com...
Hello, I have a range (D9:DP496) that contains numerical values and
text. I want to clear all the cells that do not have numerical values.
I attempted it below but failed miserably. As you can see I am a new
learner to VBA. Can you help?

If Workbooks("Regional Banks.xls").Worksheets("Regional
Banks").Range("D9:DP496") < Format ("#") Then Cells.Value = ""
End If