If integer is text???

  • Thread starter Thread starter Steff_DK
  • Start date Start date
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
 
Dim iSpecific As Integer
if not( isnumber(activeCell)) or Activecell.Text = "" then
goto NoSearch
End if

iSpecific = ActiveCell.Value
 
Hi
try

Dim iSpecific As Integer
If Isnumeric(activecell.value) then
iSpecific = ActiveCell.Value
elseif ActiveCell.Value <> "" Then
GoTo Nosearch
End If
 
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)
 
Hi Tom
you probably meant IsNumeric instead of IsNumber :-)
Besides that I'm still not sure what the OP really wants
to check :-)
 
Still no luck:

Runtime error with IsNumber

'Sub or function not defined
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top