ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Cell Types (https://www.excelbanter.com/excel-programming/336844-cell-types.html)

Kaval

Cell Types
 
I am looking for the VB equivalent to the cell type function. That is, I need
to determine if a particular cell contains a formula, a number, text or is
blank.

I guess it has to do with SpecialCells but I cant work it out.

Thanks, Kaval

Norman Jones

Cell Types
 
Hi Kaval,

Try:

dim rCell As Range

If HasFormula.rCell Then ' Formula

If Application.IsNumber(rCell.Value) Then ' Number

If Application.IsText(rCell.Value) Then ' Text

If IsEmpty(rCell.Value) Then ' Empty


---
Regards,
Norman



"Kaval" wrote in message
...
I am looking for the VB equivalent to the cell type function. That is, I
need
to determine if a particular cell contains a formula, a number, text or is
blank.

I guess it has to do with SpecialCells but I cant work it out.

Thanks, Kaval




Norman Jones

Cell Types
 
Hi Kaval,

If HasFormula.rCell Then ' Formula


Should be

If rCell.HasFormula ' Formula


---
Regards,
Norman



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

Try:

dim rCell As Range

If HasFormula.rCell Then ' Formula

If Application.IsNumber(rCell.Value) Then ' Number

If Application.IsText(rCell.Value) Then ' Text

If IsEmpty(rCell.Value) Then ' Empty


---
Regards,
Norman



"Kaval" wrote in message
...
I am looking for the VB equivalent to the cell type function. That is, I
need
to determine if a particular cell contains a formula, a number, text or
is
blank.

I guess it has to do with SpecialCells but I cant work it out.

Thanks, Kaval







All times are GMT +1. The time now is 03:25 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com