![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Feb 2002
Posts: 217
|
What is the VBA code to test a cell for its contents i.e. blank, text, number formula etc. Essentially the same info you get with =cell("Type",ref).
|
|
|
|
|
|
#2 | |
|
MrExcel MVP
Join Date: Mar 2002
Location: Chicago, IL USA
Posts: 2,042
|
Quote:
ActiveCell.HasFormula If cell is empty: IsEmpty(ActiveCell) Best way to test if cell is blank or is a formula blank (courtesy of Aladin Akyurek): Len(ActiveCell) If cell is number: WorksheetFunction.IsNumber(ActiveCell) If text: WorksheetFunction.IsText(ActiveCell) To match your formula EXACTLY: Evaluate("=Cell(""Type""," & ActiveCell.Address & ")") Regards, Jay |
|
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Feb 2002
Posts: 217
|
Thanks,
This is just what I was looking for. |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|