#1   Report Post  
lashio
 
Posts: n/a
Default test for a formula

Will someone help me write a macro to check if a selected cell contains a
formula. Please


  #2   Report Post  
Norman Jones
 
Posts: n/a
Default

Hi Lashio,

Try something like:

'=================
Public Sub FormulaTest()
If ActiveCell.HasFormula Then
'Do something, e.g.:
MsgBox "Cell " & ActiveCell.Address(0, 0) _
& " is a formula cell"
Else
'do something else, e.g.:
MsgBox "Cell " & ActiveCell.Address(0, 0) _
& " is not a formula cell"
End If
End Sub
'<<=================

---
Regards,
Norman



"lashio" wrote in message
...
Will someone help me write a macro to check if a selected cell contains a
formula. Please



  #3   Report Post  
lashio
 
Posts: n/a
Default

Hi Norman,
Thank you very much, that's what I needed.

"Norman Jones" wrote in message
...
Hi Lashio,

Try something like:

'=================
Public Sub FormulaTest()
If ActiveCell.HasFormula Then
'Do something, e.g.:
MsgBox "Cell " & ActiveCell.Address(0, 0) _
& " is a formula cell"
Else
'do something else, e.g.:
MsgBox "Cell " & ActiveCell.Address(0, 0) _
& " is not a formula cell"
End If
End Sub
'<<=================

---
Regards,
Norman



"lashio" wrote in message
...
Will someone help me write a macro to check if a selected cell contains
a formula. Please





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
IF formula? meris Excel Worksheet Functions 1 September 6th 05 07:14 AM
writing a formula for a colored value aaronwexler New Users to Excel 11 September 1st 05 03:11 PM
adding row to forumla carrera Excel Discussion (Misc queries) 9 August 23rd 05 10:24 PM
Relative Indirect Formula Referencing? Damian Excel Worksheet Functions 1 January 7th 05 04:16 AM
Help with macro formula and variable Huge project Excel Worksheet Functions 0 December 28th 04 01:27 AM


All times are GMT +1. The time now is 12:14 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"