Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 337
Default Check for wrong cell content

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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
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.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Check if content in cell is an integer prem New Users to Excel 6 May 1st 08 01:54 PM
Check if content in cell is an integer Mike H New Users to Excel 0 May 1st 08 09:53 AM
Check if cell content changed bbussoloti Excel Programming 4 December 7th 07 05:07 PM
Check Cell Content before continuing... Chris T-M Excel Programming 5 November 1st 07 03:39 AM
VBA cell content check Derek Wittman Excel Programming 7 September 6th 06 07:52 PM


All times are GMT +1. The time now is 12:47 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"