View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones[_2_] Norman Jones[_2_] is offline
external usenet poster
 
Posts: 421
Default Check for wrong cell content

Hi OldJay,

Try something like:

'==========
Public Sub Tester()
Dim WB As Workbook
Dim SH As Worksheet
Dim Rng As Range
Dim Rng2 As Range

Set WB = Workbooks("myBook.xls") '<<==== CHANGE
Set SH = WB.Sheets("Sheet2") '<<==== CHANGE

With SH
Set Rng = .Range("A1") '<<==== CHANGE
Set Rng2 = .Range("C1") '<<==== CHANGE
End With

If Not Rng.HasFormula Then
Rng2.Copy Destination:=Rng
End If

End Sub
'<<==========



---
Regards.
Norman


"Oldjay" wrote in message
...
I wish to check a cell to be sure it has a formula in it. If the cell has a
zero or number in it then I want to copy a cell with the correct formula
in
to it.