Please help with this error

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi i use this:
side =Mid(folder, (InStrRev(folder, "_") + 1))

But not all folder has a underscore
I only want to see the folder whit underscore

I understand i shall use a If but how???
Regards
alvin
 
Hi Alvin,

on error resume next
side =Mid(folder, (InStrRev(folder, "_") + 1))
if err<> then
err = 0
' underscore not found
else
'underscore found
end if
on error goto 0

Regards,
Ivan
 
Hi Alvin,

Try:

If InStr(folder, "_") Then
side = Mid(folder, (InStrRev(folder, "_") + 1))
End If
 
Thanks
its working

Alvin


Norman Jones said:
Hi Alvin,

Try:

If InStr(folder, "_") Then
side = Mid(folder, (InStrRev(folder, "_") + 1))
End If
 

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