If integer is text???

S

Steff_DK

If activecell is text I get a runtime error with the code below (o
course...).

I'd like to goto Nosearch, if cell value is text.
How can I write this into the below code?

Dim iSpecific As Integer
iSpecific = ActiveCell.Value

If ActiveCell.Value = "" Then
GoTo Nosearch
End I
 
T

Tom Ogilvy

Dim iSpecific As Integer
if not( isnumber(activeCell)) or Activecell.Text = "" then
goto NoSearch
End if

iSpecific = ActiveCell.Value
 
F

Frank Kabel

Hi
try

Dim iSpecific As Integer
If Isnumeric(activecell.value) then
iSpecific = ActiveCell.Value
elseif ActiveCell.Value <> "" Then
GoTo Nosearch
End If
 
B

Bob Phillips

Hi Steff,

If Not IsNumeric(ActiveCell.Value) Then
GoTo NoSearch
End If

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
F

Frank abel

Hi Tom
you probably meant IsNumeric instead of IsNumber :)
Besides that I'm still not sure what the OP really wants
to check :)
 
Top