MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Specifying that a cell has no value Numerical/text ?


Posted by Dominic on March 28, 2001 3:30 AM

Private Sub Workbook_BeforeClose(Cancel As Boolean)
On Error GoTo Lastline
If ActiveCell.Value = "" Then GoTo Saveline Else GoTo Lastline
Saveline:
Sheets("Data").Range("A4").Activate
Lastline:
End Sub

With the above code a "spacebar" entry has a value as well as text. How do I specify that the Cell must have no value whether it be text or numerical


Posted by Dave Hawley on March 28, 2001 3:55 AM

Hi Dominic

I may have stuffed this up but, try this:


On Error GoTo Lastline
If Not IsEmpty(ActiveCell) Then GoTo Lastline Else GoTo Saveline
Saveline:
Sheets("Data").Range("A4").Activate
Lastline:

OzGrid Business Applications

Posted by Dominic on March 28, 2001 5:50 AM


Hi Dave
It still reads that the cell has an entry when there is a space in it. What I am really trying to achieve is to test whether the cell value is numerical or text, and if numerical perform one action and if text another.

Posted by mseyf on March 28, 2001 6:16 AM

Have you tried:

If IsNumeric(ActiveCell) Then NumericAction