Is there a VB equivalent to the following XL formula?
Formula = CELL(info_type,reference).
I'm trying to determine if the active cell is a label or value.
Is there a VB equivalent to the following XL formula?
Formula = CELL(info_type,reference).
I'm trying to determine if the active cell is a label or value.

This month, every Windows Secrets subscriber can download a one-chapter excerpt of Windows 7: The Missing Manual.Windows 7: The Missing Manual provides valuable information to help you overcome these difficulties in learning a new operating system. Subscribe today to download your free excerpt.
Hi,
Any function can be coded as a worksheet functiion:
answer = Application.WorksheetFunction.CELL(info_type,refer ence)
I'm not that's the best way to do it- but I'm not sure what you mean by "a label or value". You can look at things like cells(i,j).value or cells(i,j).formula- I don't know if that's going to achieve what you want
Geoff
Subway Belconnen- home of the Signboard to make you smile. Get (almost) daily updates- follow SubwayBelconnen on Twitter.
I would use the HasFormula Property. Quote below from Microsoft Help.
"True if all cells in the range contain formulas; False if none of the cells in the range contains a formula; Null otherwise. Read-only Variant."
The sample code from help, slightly modified, with no error checking, gives the general idea how the property works.
<pre>Sub tst()
Worksheets("Sheet1").Activate
Set rr = Application.InputBox(prompt:="Select a range on this worksheet", Type:=8)
If rr.HasFormula = True Then
MsgBox "Cell(s) in the selection contains a formula"
Else
MsgBox "No Formula Found"
End If
End Sub
</pre>
HTH