View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Patrick Molloy[_2_] Patrick Molloy[_2_] is offline
external usenet poster
 
Posts: 1,298
Default Clearing only cells w/ numbers

DIM rSource as Range

SET rSource = somerange
if LEFT(TRIM(rSource.Formula),1)="=" Then
'' its a formula -- leave it
end if

"John" wrote:

I have a for loop that I want to clear only cells w/ numbers and not cells
that contain formulas or text. The following ignores cells w/ text, but
clear formulas.
If IsNumeric(Sheets(ToSheet).Range("List1").Rows(i)) Then
Sheets(ToSheet).Range("List1").Rows(i).ClearConten ts
End If
How do I test for for a formula in a cell?

I appreciate your help, -John